Skip to content

Enable console cursor movement and selection like the ISE #829

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
dbaileyut opened this issue Jun 2, 2017 · 8 comments
Closed

Enable console cursor movement and selection like the ISE #829

dbaileyut opened this issue Jun 2, 2017 · 8 comments
Labels
Area-PSReadLine Issue-Enhancement A feature request (enhancement).

Comments

@dbaileyut
Copy link

dbaileyut commented Jun 2, 2017

Feature request....

System Details

  • Operating system name and version: Windows Server 2016 Version 10.0.14393
code -v
1.12.2
19222cdc84ce72202478ba1cec5cb557b71163de

$pseditor.EditorServicesVersion
Major  Minor  Build  Revision
-----  -----  -----  --------
1      2      1      0

code --list-extensions --show-versions
[email protected]
[email protected]
[email protected]

$PSVersionTable
Name                           Value
----                           -----
PSVersion                      5.1.14393.1198
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0, 5.0, 5.1.14393.1198}
BuildVersion                   10.0.14393.1198
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

It would be great if you could enable cursor movement and text selection in the integrated console like the PowerShell ISE allows. PSReadLine support will be great but this would go a bit further by enabling:

  • Left clicking with the mouse on the command line to move the console's cursor to that location
  • Selecting a range of text (ideally, including multiple lines) with the mouse then deleting that text via the delete key, starting to type, or pasting something in (paste via keyboard or mouse).
  • Keyboard-based text selection across multiple lines (e.g. Shift+Arrow keys).

I realize you're intentionally using the standard PowerShell host instead of something like the ISE and this may require upstream changes. I'm happy to submit this feature request in a more appropriate location. This goes to providing the "best possible experience to the PowerShell community through Visual Studio Code".

Thanks for the great work - I'm excited about where this is going.

@dbaileyut
Copy link
Author

I posed this in the vscode repo but that probably wasn't the place for it. microsoft/vscode#26401 (comment)

@daviwil
Copy link
Contributor

daviwil commented Jun 2, 2017

Hey @dbaileyut, thanks for the issue! The fundamental limitation here is that VS Code's integrated terminal UI is meant to be just that, a textual terminal. I think it's unlikely that they'll ever add mouse-driven cursor movement there since it would be hard to implement that consistently cross-platform among the range of different terminal hosts.

You mention "using the ISE host", it's actually not possible to accomplish that because the ISE's host is coupled to the WPF-based UI in which it runs. The best hope we have for now is enabling PSReadline so that keyboard-based navigation is brought to the same level as the standard powershell.exe host.

Is there a scenario where the lack of mouse support is a significant limitation for your workflow?

@dbaileyut
Copy link
Author

I use the ISE for both writing/debugging scripts and as my active working terminal as a sys admin. I don't think it's much of a factor from the scripting and debugging perspective.

It's more in that working terminal usage that I've grown accustomed to the mouse support in the ISE console, having used the ISE as my console of choice basically since it was released. It's very handy to be able to arrow up through my history and then quickly change an arbitrary section of a long command (usually piping multiple things together) via the mouse before executing the revised command. I find it quicker and more precise than moving and selecting via the keyboard, even with being able to move word by word.

I think PSReadline will get me like 85%-95% there for my use case but that extra little bit is nice.

And, just to be clear, I'm not asking for this to be implemented in any specific way (e.g. using the ISE host). I'm just hoping for all the pros of VS Code with no cons compared to the ISE in my use cases. I realize that's easier said than done.

@markwkjr
Copy link

Thanks for posting this @dbaileyut
I was going to submit this feature request but noticed you already had it in.

This is applicable to me in both writing/debugging and as a working terminal. Because in either case I may want to use Keyboard-based text selection.

Guess it comes down to really liking have a "one stop shop" for an editor and PowerShell Console. Guess I could continue to use ISE full screen as Console and Edit in VS Code. Having it all in the ISE was just very convenient.

@TheShihan
Copy link

+1
If possible, please add this. It would make the transition from PowerShell ISE less painfull.

@dragonwolf83
Copy link

You can now Alt+Click to move the cursor on the command line with the mouse. This was just added in
Visual Studio Code v1.21.

@TylerLeonhardt
Copy link
Member

Recap:

Done:
✅ Left clicking with the mouse on the command line to move the console's cursor to that location

These should be coming with PSReadLine integration tracked here:

  • Selecting a range of text (ideally, including multiple lines) with the mouse then deleting that text via the delete key, starting to type, or pasting something in (paste via keyboard or mouse).
  • Keyboard-based text selection across multiple lines (e.g. Shift+Arrow keys).

Does anyone have a problem with me duping this issue to #535?

@rjmholt rjmholt added Area-PSReadLine v2 Issue-Enhancement A feature request (enhancement). labels Oct 12, 2018
@SydneyhSmith
Copy link
Collaborator

Closing this as PSReadLine is now available in the PowerShell preview extension #1793

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-PSReadLine Issue-Enhancement A feature request (enhancement).
Projects
None yet
Development

No branches or pull requests

8 participants