I think that you probably should add autocompletion functions #1780

Closed
opened 2026-01-30 22:36:19 +00:00 by claunia · 15 comments
Owner

Originally created by @Jailman on GitHub (Jun 20, 2019).

With tab key to auto complete commands is the most basic needs for adminitrators

Originally created by @Jailman on GitHub (Jun 20, 2019). With tab key to auto complete commands is the most basic needs for adminitrators
claunia added the Issue-FeatureNeeds-Tag-FixResolution-Won't-Fix labels 2026-01-30 22:36:19 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (Jun 20, 2019):

This is the responsibility of the shell. For example, PowerShell has a very powerful tab completion feature. CMD does not, and we are not going to change that.

@DHowett-MSFT commented on GitHub (Jun 20, 2019): This is the responsibility of the shell. For example, PowerShell has a _very powerful_ tab completion feature. CMD does not, and we are not going to change that.
Author
Owner

@Nils-Berghs commented on GitHub (Jun 23, 2019):

PowerShell has a 'very powerful' tab completion feature? Where did you get this idea? Have you ever used a terminal on linux or mac?

Granted the tab completion in powershell is very good voor command options but for the base command it is horrible:
On linux:

  • Enter first characters of command
  • Press tab => autocompletes letters which will follow
  • Double tab => list options
  • Enter next characters
    ...

On powershell

  • Enter first characters of command
  • Press tab => autocomplete to first possible command
  • Press tab => autocomplete te next possible command
  • Press tab => autocomplete te next possible command
  • Press tab => autocomplete te next possible command
  • ... (why have autocompletion at all, no idea if I should press tab 5,50 or 5000 times more, I'll better type the command in full)

Sure the default console applications on windows needed a UI overhaul.
But if terminal is nothing more than a UI wrapper for cmd/powershell, than it'll do little to win over developers and sys admins.... The will stick with far better terminals on other systems.

@Nils-Berghs commented on GitHub (Jun 23, 2019): PowerShell has a 'very powerful' tab completion feature? Where did you get this idea? Have you ever used a terminal on linux or mac? Granted the tab completion in powershell is very good voor command options but for the base command it is horrible: On linux: - Enter first characters of command - Press tab => autocompletes letters which will follow - Double tab => list options - Enter next characters ... On powershell - Enter first characters of command - Press tab => autocomplete to first possible command - Press tab => autocomplete te next possible command - Press tab => autocomplete te next possible command - Press tab => autocomplete te next possible command - ... (why have autocompletion at all, no idea if I should press tab 5,50 or 5000 times more, I'll better type the command in full) Sure the default console applications on windows needed a UI overhaul. But if terminal is nothing more than a UI wrapper for cmd/powershell, than it'll do little to win over developers and sys admins.... The will stick with far better terminals on other systems.
Author
Owner

@fabianlupa commented on GitHub (Jun 23, 2019):

PowerShell has a 'very powerful' tab completion feature? Where did you get this idea? Have you ever used a terminal on linux or mac?

You might want to take a look at the Ctrl + Space (MenuComplete) autocompletion available in powershell. I only found out about it by chance as I expected this behavior to be bound to Tab, just like you. Ctrl + Space is somewhat comparable to the ZSH autocompletion including parameter completion and navigation using arrow keys.

(works in normal powershell, in the new terminal currently #879 causes it to not get triggered)

@fabianlupa commented on GitHub (Jun 23, 2019): > PowerShell has a 'very powerful' tab completion feature? Where did you get this idea? Have you ever used a terminal on linux or mac? You might want to take a look at the `Ctrl + Space` (MenuComplete) autocompletion available in powershell. I only found out about it by chance as I expected this behavior to be bound to `Tab`, just like you. `Ctrl + Space` is somewhat comparable to the ZSH autocompletion including parameter completion and navigation using arrow keys. (works in normal powershell, in the new terminal currently #879 causes it to not get triggered)
Author
Owner

@Nils-Berghs commented on GitHub (Jun 24, 2019):

Hi flaiker, thank you very much. I never realized powershell has this hidden gem.
I have tried it but it is still not as powerfull/intuitive as bash style autocomplete nor will the feature ever be found by terminal users used to bash terminal (they will like me complain about the terrible autocompletion mode in powershell).

@Nils-Berghs commented on GitHub (Jun 24, 2019): Hi flaiker, thank you very much. I never realized powershell has this hidden gem. I have tried it but it is still not as powerfull/intuitive as bash style autocomplete nor will the feature ever be found by terminal users used to bash terminal (they will like me complain about the terrible autocompletion mode in powershell).
Author
Owner

@DHowett-MSFT commented on GitHub (Jun 24, 2019):

@Nils-Berghs

Where did you get this idea? Have you ever used a terminal on linux or mac?

Most of us have been using a bunch of different shells for quite a while. Please give us the benefit of the doubt. There are a bunch of different ways to do tab completion, and powershell is still trying to appeal to Windows users who like the “cycling” completion style. We can’t change that default without breaking so many people’s workflows. They really hate when we do that!

@DHowett-MSFT commented on GitHub (Jun 24, 2019): @Nils-Berghs > Where did you get this idea? Have you ever used a terminal on linux or mac? Most of us have been using a bunch of different shells for quite a while. Please give us the benefit of the doubt. There are a bunch of different ways to do tab completion, and powershell is still trying to appeal to Windows users who like the “cycling” completion style. We can’t change that default without breaking so many people’s workflows. They really _hate_ when we do that!
Author
Owner

@Nils-Berghs commented on GitHub (Jun 24, 2019):

DHowett, I understand that you want to keep the cycling style (even as a default). But I thought part of the goal of the terminal was to create an appealing environment for sys admins and developers. That audience have indeed been using shells on all kind of platforms. Various half baked solutions for better tab behaviour have been implemented for as long as the windows dominance has started to fade among developers (late 200X).
I was hoping that a new windows terminal would finally address these issues. But if such a request is closed with 'we have decent tab completion' than I fear Microsoft hasn't really understand the audience they are trying to please

@Nils-Berghs commented on GitHub (Jun 24, 2019): DHowett, I understand that you want to keep the cycling style (even as a default). But I thought part of the goal of the terminal was to create an appealing environment for sys admins and developers. That audience have indeed been using shells on all kind of platforms. Various half baked solutions for better tab behaviour have been implemented for as long as the windows dominance has started to fade among developers (late 200X). I was hoping that a new windows terminal would finally address these issues. But if such a request is closed with 'we have decent tab completion' than I fear Microsoft hasn't really understand the audience they are trying to please
Author
Owner

@DHowett-MSFT commented on GitHub (Jun 24, 2019):

The core problem here is that it’s just outside of Windows Terminal’s control. Terminal is just a window through which you communicate with text-mode applications. We speak with the team that owns powershell, and they’re generally receptive to discussions over on their GitHub repository.
As much as we would like to change this ourselves, Terminal just sees text and escape sequences.

@DHowett-MSFT commented on GitHub (Jun 24, 2019): The core problem here is that it’s just outside of Windows Terminal’s control. Terminal is just a window through which you communicate with text-mode applications. We speak with the team that owns powershell, and they’re generally receptive to discussions over on their GitHub repository. As much as we would like to change this ourselves, Terminal just sees text and escape sequences.
Author
Owner

@Nils-Berghs commented on GitHub (Jun 25, 2019):

Well my hope is that terminal will bring Windows terminal experience on par (or ahead) of other platforms.
The classic command prompt had three big problems: power, UI and usability. PowerShell fixed the first (as it is a very capable shell), but did little to improve usability, as for UI it's hard to tell which looked better (or worse).
The new terminal will definitely fix the UI (just look at how good the first version is). Let's hope that we don't have to wait another decade before the last issue of the command prompt is finally addressed).

Keep up the good work.

@Nils-Berghs commented on GitHub (Jun 25, 2019): Well my hope is that terminal will bring Windows terminal experience on par (or ahead) of other platforms. The classic command prompt had three big problems: power, UI and usability. PowerShell fixed the first (as it is a very capable shell), but did little to improve usability, as for UI it's hard to tell which looked better (or worse). The new terminal will definitely fix the UI (just look at how good the first version is). Let's hope that we don't have to wait another decade before the last issue of the command prompt is finally addressed). Keep up the good work.
Author
Owner

@oising commented on GitHub (Jun 25, 2019):

@Nils-Berghs

https://docs.microsoft.com/en-us/powershell/module/psreadline/about/about_psreadline?view=powershell-6

PowerShell has EMACS, VI and Windows mode commandline editing experience with the PSReadline module, with inline editing, ctrl+r reverse history search etc etc, just like bash and others. It's been around a long time and ships in-box these days, so perhaps you're judging your experiences from using older versions of powershell on crusty windows servers.

@oising commented on GitHub (Jun 25, 2019): @Nils-Berghs https://docs.microsoft.com/en-us/powershell/module/psreadline/about/about_psreadline?view=powershell-6 PowerShell has EMACS, VI and Windows mode commandline editing experience with the PSReadline module, with inline editing, ctrl+r reverse history search etc etc, just like bash and others. It's been around a long time and ships in-box these days, so perhaps you're judging your experiences from using older versions of powershell on crusty windows servers.
Author
Owner

@Nils-Berghs commented on GitHub (Jun 25, 2019):

Oising, my apologies. PS-readline was one of the last things I tried before I gave up on powershell (must have been a couple of years ago). I did not realize how far it has come (but as it took serveral days and persons before someone mentioned it I guess I'm not alone). So the issue is no longer to implement it but to spread the word. I'll definitely be helping with that.
(on a side note set-psreadline options, chrashes on powershell6 and is not persistent on ps5.1.... some more tinkering/googling to do, but that 'll be for another day )

@Nils-Berghs commented on GitHub (Jun 25, 2019): Oising, my apologies. PS-readline was one of the last things I tried before I gave up on powershell (must have been a couple of years ago). I did not realize how far it has come (but as it took serveral days and persons before someone mentioned it I guess I'm not alone). So the issue is no longer to implement it but to spread the word. I'll definitely be helping with that. (on a side note set-psreadline options, chrashes on powershell6 and is not persistent on ps5.1.... some more tinkering/googling to do, but that 'll be for another day )
Author
Owner

@zadjii-msft commented on GitHub (Jul 2, 2019):

@Nils-Berghs I also want to chime in and hopefully clear up some confusion. I believe you're confusing two very similar applications and their responsibilities.

When you launch powershell or cmd on Windows (prior to the Windows Terminal), you're actually creating two processes:

  • The shell application, powershell.exe or cmd.exe. This is the application that's responsible for processing input text and running commands and scripts and such. The shell is a part of the broader category of commandline applications, which are text-only*, without a window of their own. This is similar to bash, zsh, fish, etc. on *nix.
  • The Terminal application, conhost.exe. This is the app that's responsible for acting as the window for the commandline application attached to it. Both powershell and cmd ("Console"/"Command Prompt") use conhost as their window.

From your categories listed above, it sounds like "power" fits under the category of something the shell should be responsible for, while UI is something the Terminal is responsible for. I'm not really sure how "usability" isn't just the combination of the two.

So with the Windows Terminal, we're hoping to improve the UI, but the Terminal itself won't really affect the shell applications.

@zadjii-msft commented on GitHub (Jul 2, 2019): @Nils-Berghs I also want to chime in and hopefully clear up some confusion. I believe you're confusing two very similar applications and their responsibilities. When you launch `powershell` or `cmd` on Windows (prior to the Windows Terminal), you're actually creating _two_ processes: * The _shell_ application, `powershell.exe` or `cmd.exe`. This is the application that's responsible for processing input text and running commands and scripts and such. The shell is a part of the broader category of commandline applications, which are text-only\*, without a window of their own. This is similar to `bash`, `zsh`, `fish`, etc. on \*nix. * The _Terminal_ application, `conhost.exe`. This is the app that's responsible for acting as the window for the commandline application attached to it. Both `powershell` and `cmd` ("Console"/"Command Prompt") use `conhost` as their window. From your categories listed above, it sounds like "power" fits under the category of something the shell should be responsible for, while UI is something the Terminal is responsible for. I'm not really sure how "usability" isn't just the combination of the two. So with the Windows Terminal, we're hoping to improve the UI, but the Terminal itself won't really affect the shell applications.
Author
Owner

@ghost commented on GitHub (Jul 11, 2019):

There is an old chinese saying: "The soldier works out his victory in relation to the foe whom he is facing; water shapes its course according to the nature of the ground over which it flows; ", so we develop convenient features for satisfaction of friendly usage.

@ghost commented on GitHub (Jul 11, 2019): There is an old chinese saying: "The soldier works out his victory in relation to the foe whom he is facing; water shapes its course according to the nature of the ground over which it flows; ", so we develop convenient features for satisfaction of friendly usage.
Author
Owner

@fabiomarreco commented on GitHub (Oct 8, 2019):

@Nils-Berghs, for bash-style autocomplete set:

Set-PSReadlineKeyHandler -Key Tab -Function Complete

you´ll need to put that on your profile.ps1 to persist it.

@fabiomarreco commented on GitHub (Oct 8, 2019): @Nils-Berghs, for bash-style autocomplete set: ``` Set-PSReadlineKeyHandler -Key Tab -Function Complete ``` you´ll need to put that on your profile.ps1 to persist it.
Author
Owner

@privacyguy123 commented on GitHub (Feb 10, 2020):

Autosuggestions similar to zsh-autosuggestions would be amazing!

@privacyguy123 commented on GitHub (Feb 10, 2020): Autosuggestions similar to zsh-autosuggestions would be amazing!
Author
Owner

@DHowett-MSFT commented on GitHub (Feb 10, 2020):

Unfortunately, requests for that will just have to go to PowerShell itself.

@DHowett-MSFT commented on GitHub (Feb 10, 2020): Unfortunately, requests for that will just have to go to PowerShell itself.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1780