With tab key to auto complete commands is the most basic needs for adminitrators
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.
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:
On powershell
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.
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)
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
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, 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
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.
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
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, 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 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:
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.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.
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.
@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.
Autosuggestions similar to zsh-autosuggestions would be amazing!
Unfortunately, requests for that will just have to go to PowerShell itself.
Most helpful comment
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.