Skip to content

Conversation

@andyleejordan
Copy link
Member

Per #1085, there was confusing over keybindings on Linux / OS X. Since we use PSReadLine, it is up to the user to choose a preferred editing mode, and PSReadLine reasonably defaulted to Windows. However, this leads to a subpar experience on non-Windows platforms, where almost everything respects Emacs keybindings (especially shells).

This fixes PSReadLine so that the key bindings are set based on the default edit mode, and sets the default edit mode to Emacs when LINUX is defined. Pester tests are included.

I do, however, have an open question for @lzybkr about the need to _chordDispatchTable.Clear() when changing key bindings. Each of SetDefaultWindowsBindings(), SetDefaultEmacsBindings() and SetDefaultVimBindings() bind _chordDispatchTable to a new dictionary, thus overwriting it. Is it actually necessary then to clear the previous value?

@andyleejordan
Copy link
Member Author

/cc @wimcoekaerts

@lzybkr
Copy link
Contributor

lzybkr commented Jul 15, 2016

LGTM

@lzybkr lzybkr merged commit 5a1432e into master Jul 15, 2016
@andyleejordan andyleejordan deleted the andschwa/default-editmode branch July 15, 2016 22:58
@lzybkr
Copy link
Contributor

lzybkr commented Jul 15, 2016

@andschwa - you're right, it looks like the call to Clear is no longer needed.

@andyleejordan andyleejordan mentioned this pull request Jul 15, 2016
11 tasks
@wimcoekaerts
Copy link

ah ok I did try again with Emacs mode and it worked. not sure why it didn't the first time but it worked this time so all good :)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants