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

set -o vi and emacs should be have differently while interactive #659

Closed
andychu opened this issue Mar 15, 2020 · 4 comments
Closed

set -o vi and emacs should be have differently while interactive #659

andychu opened this issue Mar 15, 2020 · 4 comments

Comments

@andychu
Copy link
Contributor

andychu commented Mar 15, 2020

$ bash   --rcfile /dev/null -i -c ' test -o emacs; echo $?; test -o vi; echo $?'
0
1
andy@lisa:~/git/oilshell/oil$ bin/osh --rcfile /dev/null -i -c ' test -o emacs; echo $?; test -o vi; echo $?'
1
1

By the way, the line-editing can be turned off in interactive sessions of Bash. The setting is set +o emacs. This is the reason why set +o emacs doesn't imply set -o vi in Bash unlike in Oil.

@andychu
Copy link
Contributor Author

andychu commented Mar 15, 2020

From #653

@andychu
Copy link
Contributor Author

andychu commented Mar 18, 2020

@akinomyoga I made it behave more like bash, passing a test with -i, but I didn't do a lot more testing.

I think the problem is that GNU readline has some state, and bash has some state, and they have to be synchronized. But there is not a great way of testing GNU readline state in batch mode, as far as I know...

FWIW: I learned that mksh has set -o emacs on both interactively and in batch mode. I guess bash does make a little bit of sense since this is an interactive feature only.

@akinomyoga
Copy link
Collaborator

Thank you! I have tested. I removed a workaround from ble.sh/osh branch for this.

FWIW: I learned that mksh has set -o emacs on both

Oh, really. I haven't tried ble.sh on other shells, so I didn't know that.

@andychu
Copy link
Contributor Author

andychu commented Mar 25, 2020

@andychu andychu closed this as completed Mar 25, 2020
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

2 participants