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

I think that you probably should add autocompletion functions #1341

Closed
Jailman opened this issue Jun 20, 2019 · 15 comments
Closed

I think that you probably should add autocompletion functions #1341

Jailman opened this issue Jun 20, 2019 · 15 comments
Labels
Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Tag-Fix Doesn't match tag requirements Resolution-Won't-Fix We're just really obstinate about this. There's probably a good reason.

Comments

@Jailman
Copy link

Jailman commented Jun 20, 2019

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

@Jailman Jailman added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Jun 20, 2019
@ghost ghost added Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Jun 20, 2019
@DHowett-MSFT
Copy link
Contributor

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 DHowett-MSFT added Resolution-Won't-Fix We're just really obstinate about this. There's probably a good reason. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Jun 20, 2019
@Nils-Berghs
Copy link

Nils-Berghs commented 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.

@fabianlupa
Copy link

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)

@Nils-Berghs
Copy link

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).

@DHowett-MSFT
Copy link
Contributor

@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!

@Nils-Berghs
Copy link

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

@DHowett-MSFT
Copy link
Contributor

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.

@Nils-Berghs
Copy link

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.

@oising
Copy link
Collaborator

oising commented 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.

@Nils-Berghs
Copy link

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 )

@zadjii-msft
Copy link
Member

@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.

@ghost
Copy link

ghost commented 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.

@fabiomarreco
Copy link

@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.

@privacyguy123
Copy link

Autosuggestions similar to zsh-autosuggestions would be amazing!

@DHowett-MSFT
Copy link
Contributor

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

@microsoft microsoft locked as resolved and limited conversation to collaborators Feb 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Tag-Fix Doesn't match tag requirements Resolution-Won't-Fix We're just really obstinate about this. There's probably a good reason.
Projects
None yet
Development

No branches or pull requests

8 participants