Skip to content
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

running some interactive program via keybinding doesn't work as expected #4772

Open
mcfog opened this issue Mar 2, 2018 · 2 comments
Open

Comments

@mcfog
Copy link

mcfog commented Mar 2, 2018

$ fish -v
fish, version 2.7.1

$ bind \cq 'zsh'
(press ctrl+q)
(zsh works well, invoke bash in it also works)

$ bind \cq 'bash'
(press ctrl+q)
(bash prompt appear, but press enter, the prompt appear in the same line instead of nextline, inputing command don't appear... see screen shot after)

$ bind \cq 'ssh localhost'
(press ctrl+q)
(after ssh into localhost, the fish works well, but invoking bash in it failed to work, same as above)

2018-03-02 6 31 23

Background: I'm trying to implement some shortcut key to pick an remote machine with fzf and ssh into picked machine, when I run my function by typing its name, it works well, but it failed with keybinding

@mqudsi
Copy link
Contributor

mqudsi commented Mar 2, 2018

Off the top of my head: it's possible bash doesn't steal the terminal for itself and relies on the parent to assign it and fish is executing the bind actions in the background?

@faho faho added this to the fish-future milestone Sep 22, 2018
@faho
Copy link
Member

faho commented Mar 27, 2019

The underlying issue here is that we don't reset the terminal modes when we execute a command via a binding. zsh seems to reset them, while bash doesn't. However, it does generally work, it just won't show characters echo'd.

Maybe we should reset the terminal modes in this case?

The workaround is to add stty sane to the binding, like bind \cq 'stty sane; bash'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants