-
-
Notifications
You must be signed in to change notification settings - Fork 801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wezterm uses the login shell in /etc/passwd
instead of the SHELL
environment variable
#4098
Comments
wezterm isn't spawning any ssh-agents; your login shell is spawning them. I would suggest making your shell logic conditional; for example, checking to see if Alternatively, you can set your Note that wezterm's own built-in ssh client would prefer it if the agent is already running before wezterm is started, so that it can itself use your ssh agent. |
Ok thanks, now I understand where the problem comes from. I will have to look into it but if I'm not mistaken, wezterm should not be using my login shell. Usually terminal emulators flow is:
My
There's no reason for wezterm to use my |
/etc/passwd
instead of the SHELL
environment variable
wezterm doesn't use If you don't want to set the correct shell in the password database, then the resolution is for you to change the |
also: why is your /etc/passwd shell set to |
I was unable to find any specification regarding the
I was also unable to find anything on vt100.net, so I guess it's not really a requirement for terminal emulators to use it.
This is the correct shell ! What do you want me to use ? The login shell should be a POSIX compliant shell, people using shells such as zsh in their passwd db are prone to a lot of trouble (even if the doc says there's an "emulated POSIX compliance"). I've experienced it in the past, some stuff broke randomly, it was very hard to debug and understand that the apparently-not-really-posix-shell was the culprit. I could use bash but I'd rather use dash which is faster and smaller (less prone to bugs). Having But Though I still think you should be using the EDIT: I think the likelihood of users running EDIT2: FYI on modern GNU/Linux distributions |
Well, I just noticed that even if I use |
It seems to me that your usage of SHELL is a bit unusual.
(wezterm operates along those same principles: it is initiating your sessions) The login shell is not implicitly or explicitly required to be There are no rules against having other shells as the default, and in fact most modern unix systems use either bash or zsh by default. If you intend to use zsh, then there should be no problems making Some people fear setting the shell of the root user to anything other than a basic For users that follow the standard approach, wezterm's use of the passwd entry to respect the latest changes made via For users that are doing something unusual, then the combination of |
Alright I can see the reasoning here. Even though I don't think it's a good idea to assume that the login shell and the "regular" shell are always the same, your "is initiating sessions" reasoning makes sense to me, it also explains why you set the SHELL variable. I have to say however that it's the first time I use a terminal emulator that doesn't comply with my SHELL variable, others behave as I would expect, and I don't think it's that "unusual" to quote you. Thanks for your explanations |
* Allow set_environment_variables to set the SHELL. Previously, we'd always set it to the shell from the password database. Now we do that by default, but if set_environment_variables has been used, we'll preserve that value for the environment of the to-be-spawned process * Clarify the docs: * Remove the confusing version dependent sections that started with old behavior and rewrite in terms of the behavior that has been true for the past year * I've heard from a few people that they tried to change COMSPEC on Windows and pain ensued. Try to nudge them to read the next paragraph that tells them what they are actually supposed to change. refs: #4098 refs: #4168 closes: #3816 refs: #3317
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Nothing in that post is relevant, this is not an ssh issue, see the comments down below.
What Operating System(s) are you seeing this problem on?
Linux Wayland
Which Wayland compositor or X11 Window manager(s) are you using?
WezTerm version
Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?
Yes, and I updated the version box above to show the version of the nightly that I tried
Describe the bug
Fresh boot, after opening wezterm :
As you can see, 2 ssh-agents are running.
I spawn my own ssh agent in the config of my login shell. I have the following in
~/.profile
:Moreover, everytime I spawn a new terminal, a new ssh agent is spawned, resulting in many instances being run at the same time:
To Reproduce
eval $(ssh-agent) > /dev/null
to your login shell. For me it's~/.profile
because I'm using dash, but for you it might be~/.bash_profile
is you're using bash.ps aux | grep ssh-agent
Configuration
no config
Expected Behavior
wezterm should use the existing ssh agent instead of spawning new ones
Logs
Anything else?
I use KeePassXC's SSH agent integration to manage my SSH keys. It is in charge of inserting/removing keys from memory when the database is being unlocked/locked. It relies on
SSH_AUTH_SOCK
to know which ssh agent to use. Because wezterm spawns its own ssh agent and setSSH_AUTH_SOCK
accordingly, I'm unable to connect to my servers by using SSH keys already available in the ssh-agent I run.I'm pretty sure it's irrelevant, but just in case:
The text was updated successfully, but these errors were encountered: