You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like my password manager integration plugin to detect whether the password I'm about to "paste" will be echoed to the terminal, even when sudoing via SSH.
Currently, the only working method I have found is:
Output a few characters.
Check if they were echoed.
Delete them again.
This is not optimal because the characters will be interpreted by whatever software you are in (e.g., vim) if done accidentally.
Proposed Solution
I’d love to have a Lua function that can directly tell me if echo is on. IIRC, iTerm2 does something similar for its password manager, so I assume it’s technically possible.
Based on some online research, my understanding is that during SSH sessions, programs like sudo temporarily disable echo via stty -echo for password prompts. These PTY changes are forwarded over SSH to the terminal emulator using control sequences.
Since WezTerm likely already processes these terminal mode requests when the remote shell changes PTY flags, perhaps these changes (at least the echo state) could be tracked and exposed to Lua.
Other Things Tried
I also explored whether i could find special characters to be output that wouldn’t affect the application (e.g., vim) but could still be used to detect echo. Unfortunately, I haven’t had success with this approach.
The text was updated successfully, but these errors were encountered:
https://wezterm.org/config/lua/pane/get_metadata.html#password_input is the closest thing we have to this functionality.
It only works for local terminal panes. There isn't currently a mux protocol equivalent to this function.
Note that running other terminal programs may hide this information from wezterm, even for local programs, so your remote ssh session may obscure this because they proxy ptys and may not propagate this status.
I would like my password manager integration plugin to detect whether the password I'm about to "paste" will be echoed to the terminal, even when sudoing via SSH.
Currently, the only working method I have found is:
This is not optimal because the characters will be interpreted by whatever software you are in (e.g.,
vim
) if done accidentally.Proposed Solution
I’d love to have a Lua function that can directly tell me if echo is on. IIRC, iTerm2 does something similar for its password manager, so I assume it’s technically possible.
Based on some online research, my understanding is that during SSH sessions, programs like
sudo
temporarily disable echo viastty -echo
for password prompts. These PTY changes are forwarded over SSH to the terminal emulator using control sequences.Since WezTerm likely already processes these terminal mode requests when the remote shell changes PTY flags, perhaps these changes (at least the echo state) could be tracked and exposed to Lua.
Other Things Tried
I also explored whether i could find special characters to be output that wouldn’t affect the application (e.g.,
vim
) but could still be used to detect echo. Unfortunately, I haven’t had success with this approach.The text was updated successfully, but these errors were encountered: