Under Windows 10, go to Apps & Feature, look for FluentTerminal, go to Advanced Options, under Reset, click Repair.
The environment variable are reload correctly.
You will need to close all windows and the system tray component, only then will relaunchinv the app let you see changes in environment variables.
Hi @Riebart, thanks for the quick reply. I did not noticed the tray icon before and I now moved it to be always visible. 馃憤
However, I don't understand why the variables are not reloaded if I open a new tab with a new session of PowerShell. If the environment variable are not reloaded from scretch, does it implies that they also share other things/resources? I'm asking this just to be aware to what is going on under the hood 馃槃
The reason that you need to restart the system tray service is that the terminal windows you see are just the front end to the shell processes. Those shell processes (In your case, powershell.exe) are spawned by the system tray service, and then your windows connect to the system tray service, and the text you see/send passes back and forth over a connection between the window and the system tray service.
So when you change an environment variable, that change is only reflected in _new_ processes, and spawned terminals will only inherit the _old_ environment (before you made your changes) that the system tray service was launched with originally.
We might be able to improve this with ConPTY since we get more control on how the processes are created
@Riebart thanks for the explanation. It's all clear 馃憤
@felixse thanks for reaching out and for considering an improvement for FluentTerminal. My two cents here is that, from a user perspective (and even more from a Developer perspective), is much more intuitive that, by opening a new, say, powershell tab, the new terminal is like a new process and everything is started anew, including environment variable.
If contrarily this is not the case, I suggest to make it clear in the documentation/wiki/FAQ 馃槂
By the way, great work with FT. I really like it and use it on a daily-basis 馃帀
PS: what is the module name (or whatever it is) that change your terminal prompt line as in the screenshot image of the home project page? It's really cool and similar to the one present in Debian!
I totally agree with you on this, I just didn't come around to address this issue so far.
I have described my setup here but you can also achieve similar results with the fish shell and oh-my-fish or zsh and oh-my-zsh
@felixse great, thanks for sharing your opinion about this matter.
I'm looking forward to further updates on this issue 馃憤
Thanks for the setup instruction, I finally have a very cool theme as well 馃帀
It is important to understand that this behaviour is almost ubiquitous. Cmder also behaves like this, as well as the standard terminal emulators on Ubuntu (you need to configure them run the shell command as a login shell to get it to load the new environment files on launch). Solving this, in the unix world, is done by the shell (bash, etc...), not the terminal emulator (xterm, etc...).
At it's core, it is because environment variables are inherited from parent processes, and without special actions taken by the process (unix shells will typically read profile scripts in /etc/profile.d, and the user's home directory when started, with the specific scripts being read depending on whether the shell is started interactively or not), changes to the system environment will not propagate to those grandchild processes.
With ConPTY, we _may_ be able to do something about this, but a portable solution would be adding scripts for your powershell profiles that re-read the system environment, and insert it when the process is launched, like bash and other unix shells do.
Most helpful comment
You will need to close all windows and the system tray component, only then will relaunchinv the app let you see changes in environment variables.