10000 Support for ctrl-d to exit powershell · Issue #1085 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content

Support for ctrl-d to exit powershell #1085

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

Closed
wimcoekaerts opened this issue Jun 9, 2016 · 8 comments
Closed

Support for ctrl-d to exit powershell #1085

wimcoekaerts opened this issue Jun 9, 2016 · 8 comments

Comments

@wimcoekaerts
Copy link

I, like many *nix folks, am used to typing ctrl-d to exit my shell. Most if not all linux commandline tools that have a ‘shell’ support control-d out of it. Whether it’s screen, bash, an ssh session, mail, cat I want to leave.

@andyleejordan
Copy link
Member

@wimcoekaerts the latest released version, v0.4.0, supports Ctrl-D to exit PowerShell (by way of integrating PSReadLine).

@wimcoekaerts
Copy link
Author

Are you sure? I just installed v0.6.0. As per below. I start bash, hit control-d and it exits. I start powershell, hit contr-d and it doesn't.

[root@ol72 ~]# bash
[root@ol72 ~]# exit
[root@ol72 ~]# powershell
Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.

PS /root> ^D
: The term '' is not recognized as the name of a cmdlet, function, script fi
le, or operable program. Check the spelling of the name, or if a path was inclu
ded, verify that the path is correct and try again.
At line:1 char:1
+

  • ~
    • CategoryInfo : ObjectNotFound: (:String) [], CommandNotFoundEx
      ception
    • FullyQualifiedErrorId : CommandNotFoundException

PS /root>

@wimcoekaerts wimcoekaerts reopened this Jul 14, 2016
@andyleejordan
Copy link
Member

Ah, let me explain 😄

The keybindings are controlled by PSReadLine (more specifically, our internal port of it to Linux, that we intend to extract back to the public project as soon as we can do that). PSReadLine's default edit mode is Windows style, where Ctrl-D is unbound.

I believe this is what you're seeing. Set your edit mode to Emacs (Set-PSReadlineOption -EditMode Emacs), and you'll have the more Bash-like experience where Ctrl-D is bound to DeleteCharOrExit.

So this is supported, and it's just user preference.

@wimcoekaerts
Copy link
Author

ah setting it to Vi works.

ok. so should we set that as the default for Linux powershell then ?

@andyleejordan
Copy link
Member

Now that's the question 😃! I've asked @lzybkr, and we think it's probably not a bad idea to do this.

@lzybkr
Copy link
Contributor
lzybkr commented Jul 15, 2016

Setting Emacs mode will work too. The question is - what should the default be? I'd say Emacs, I think @jpsnover will agree because we want to make Linux folks happy. The only minor issue is keeping folks coming from Windows happy - but they can just set the mode in their profile.

@vors
Copy link
Collaborator
vors commented Jul 15, 2016

I think it's consistent with our approach to aliases.

@wimcoekaerts
Copy link
Author

vi or emacs. I don't care i am not religious about that :) I did try emacs and that didn't work Vi did work. let me try in another environment again but I did try both and Vi OK Emacs not :)

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

No branches or pull requests

4 participants
0