3 ms·
Here's a possible idea for an open-source project if someone is qualified. Make it as easy as it is in Windows.
by fuzzfactor 2y ago
Here's a possible idea for an open-source project if someone is qualified.
Make it as easy as it is in Windows.
- 01HNNWZ0MV43FF 2y agoI feel like it's harder in Windows. You mean, there should be a GUI to do it instead of .bashrc?
- sieabahlpark 2y agoYou haven't edited env vars in the path since win 8 then. At some point they made a GUI for env vars and the path variable.
- saint_yossarian 2y agoThat GUI has been there since at least XP.
- ziml77 2y agoIt's improved since then though. When you edit the PATH variable it presents a list of items you can edit and reorder rather than one long delimited string
- mixmastamyk 2y agoNT4
- deleted 2y ago[deleted]
- p_ing 2y agoWhy do you feel it is harder in Windows? In Windows 11, go into the Settings app, search for 'Path', then choose "Edit environment variables <in system/in account>". You then get a graphical method to add/edit/delete entries, and the paths apply to any application you run. No need to find a dotfile to edit. No need to know how to format a particular entry, or chain it with the existing $PATH. On macOS it is arguably harder as you need to use Cmd-Shift-. to reveal dotfiles should you be uncomfortable editing them with vim/nano/etc. When using Omz with Terminal, a path entry could be in any number of files supporting Omz along with my zshrc. Windows doesn't have this issue. Windows has it's issues, but env vars are significantly easier to manipulate without much knowledge.
- forgotpwd16 2y agoDon't even have to use GUI. Can do: setx path "%path%;C:\own\path\" Sadly this has no error checking so it may mess things up. But it's an option.
- p_ing 2y agoRight, but that's not easier, it's quicker. You need to know about setx, the path argument, and how to properly set a new path.
- forgotpwd16 2y agoThe Windows has a system-wide variables (incl. PATH) applicable everywhere. In contrast, the Linux situation is touched in the submitted article. >All of these directions only work if you’re running the program from your shell. If you’re running the program from an IDE, from a GUI, in a cron job, or some other way, you’ll need to add the directory to your PATH in a different way, and the exact details might depend on the situation. >I’m honestly not sure how to handle it in an IDE/GUI because I haven’t run into that in a long time, will add directions here if someone points me in the right direction. The ~/.pam_environment was the equivalent to Windows' environment variables but has been deprecated and supposedly systemd's environment.d took over its functionality.
- jillyboel 2y agoyou can just stick it in /etc/environment and reboot if you want
- dingnuts 2y agoI don't know what she means about setting the PATH for a GUI. If you want to run a program from the GUI you add a .desktop file to ~/.local/share/applications and provide the full path to the binary as part of the Exec key[0] You can also override the actual PATH variable for an application in the .desktop file as well, or any environment variable, with the Environment key, if that's what she means. 0 https://specifications.freedesktop.org/desktop-entry-spec/latest/exec-variables.html https://specifications.freedesktop.org/desktop-entry-spec/la...
- mock-possum 2y agoThere should certainly be a GUI to do it.
- p_ing 2y agoThe difference on Linux/BSD/macOS is that the Window Server is a userland application -- you can't depend on it existing (except macOS), nor can you depend on the underlying shell being consistent on a given OS/distribution (macOS ships with a deprecated bash shell and current zsh shell). On Windows, Microsoft has it easy. The window server is part of the executive; Win32/conhost always exist, even if you choose to run another personality (OS/2, POSIX, et. al.). I would bet that there is a form of graphical editor somewhere out there on the Internet that someone developed for fun for a given shell.
- fuzzfactor 2y ago>You mean, there should be a GUI That must have been what Microsoft was figuring back in the 20th century. Even in the latest W11, it's the same basic everyday GUI as in Windows XP :) Just a little more intuitive now. In XP from the Control Panel click System > Advanced > Environment Variables. In Win11 from Settings click System > About > Advanced System Settings > Environment Variables. Pay attention to your choice of User PATH, in addition to System PATH. Make sure that things like %HOMEDRIVE% that you edit in, actually appear as "C:" once you are done editing, or you're not doing it ideally.
- Lanolderen 2y agoTbh the moment you need to use a terminal is the moment you're googling the magic spell unless you've previously googled the magic spell. On Windows you just go Win->start typing "environment variable" and you get "Edit the system environment variables - Control Panel". Kinda stupid that you then need to press "Environment Variables..." but I probably wouldn't have to google it.
- zokier 2y agoThe problem is that Linux does not have solid way of setting environment variables for an user (or user session). .bashrc is relevant for only bash (obviously), but bash is not the only thing that needs PATH and other env vars. At least systemd brought some sanity with environment.d, but as this thread (and jvns article) shows it's not very well known. And of course there is still all sorts of weird inherited complexity like pam_env.
- tpoacher 2y ago[flagged]
- okkdev 2y agoIt's not any easier on windows tho
- the__alchemist 2y agoIt is. You go to Env vars, and modify the PATH setting. It just works. I'm confused on the Linux point, because I thought I was the only one who had problems. Until I saw this article! Describes it well. I take responsibility; I am bad at setting env vars in Linux.
- mock-possum 2y agoI found Rapid Environment Editor for that stuff year ago, never looked back.
- zabzonk 2y agoI'd second this - REE is a great utility.
- PaulKeeble 2y agoIts consistent on windows across shells but its also a hard to find feature if you haven't been using Windows for decades and its not easily scripted. Its still kind of hard, could be a lot easier than it is.
- duped 2y agoIt's in the registry, iirc. All Linux needs is a standard persistent key/value store(*) that by convention shells check for environment variables before running their rc scripts. So it will never happen. * the file system doesn't count