terminal icon indicating copy to clipboard operation
terminal copied to clipboard

Request: Right-click menu inside TerminalControl (w/ Copy & Paste?)

Open ianceicys opened this issue 6 years ago • 33 comments

I use cmd.exe's right-click on the menu bar to Select All, Mark, Find, Copy, and Paste. I would like Windows Terminal to support a similar feature. Conhost.exe image I also get the right mouse button on WSL's Ubuntu console. image

ianceicys avatar Oct 26 '19 02:10 ianceicys

Seems vaguely related to #1912 as well.

This might require some more detailed design discussion. For example, if you right click on the titlebar (when tabs aren't in the titlebar), then it makes sense that these options would apply only to the active tab/pane. Start a selection in the current tab, copy the current tab's selected text, etc.

What about if you right-click on a tab that's not focused? Would "copy" there copy the text from the unfocused tab?

Would "find" still bring up the search dialog for the currently focused pane?

zadjii-msft avatar Oct 28 '19 14:10 zadjii-msft

Same request here. Not having a right-click menu seriously reduces Terminal's usability compared to MobaXterm on Windows and Konsole in KDE on Linux.

jdrch avatar Mar 11 '20 14:03 jdrch

Yes, please! Here is what it looks like in Konsole, it is incredibly useful

image

cor3ntin avatar Mar 20 '20 08:03 cor3ntin

@cor3ntin Literally this a million times over. That's what an actually useful terminal app is supposed to do/look like.

jdrch avatar Mar 20 '20 16:03 jdrch

You don’t need to throw shade to make your point.

DHowett-MSFT avatar Mar 20 '20 16:03 DHowett-MSFT

@DHowett-MSFT I'm just being honest. There's a reason I have Terminal installed but still use MobaXTerm, even for my WSL instance (which I had to blow away anyway to get an Insider Build update to take, but that's another story.) Stuff like lack of a right-click really diminishes the usefulness of a terminal emulator to me because I can't even use the context menu keyboard button in it. If I said otherwise I'd be lying. 🤷‍♂️

And no, I'm not a hater. More of my PCs run Windows 10 (5) than run any other OS and Windows is my daily driver at work and home.

jdrch avatar Mar 20 '20 20:03 jdrch

This terminal is a highly customizable UWP app that also has a context menu and looks cleaner and better than the official Windows Terminal app. I was thinking why don't we take that app as an "inspiration"?

SFM61319 avatar Apr 28 '20 18:04 SFM61319

@SFM61319 Thanks for sharing a link to fluentterm on multiple bug reports on our repo. We'll take it into consideration.

DHowett-MSFT avatar Apr 28 '20 18:04 DHowett-MSFT

This context menu should also include the pane commands "Split Vertically" and "Split Horizontally"

mdtauk avatar Apr 28 '20 20:04 mdtauk

@mdtauk Which other terminal apps have that feature? Just curious. Most multiplexing is done server-side via byobu, tmux, or something similar.

jdrch avatar Apr 28 '20 20:04 jdrch

@jdrch the feature is there, however it can only be used via keyboard shortcuts.

mdtauk avatar Apr 28 '20 20:04 mdtauk

@mdtauk Ah. TIL!

jdrch avatar Apr 28 '20 20:04 jdrch

@jdrch Hyper, Terminator, Windows Terminal (see #1000), iterm2

zadjii-msft avatar Apr 28 '20 20:04 zadjii-msft

@mdtauk Ah. TIL!

This is why I think the feature needs more UI awareness

mdtauk avatar Apr 28 '20 20:04 mdtauk

Also, the profile menu and the buttons don't look much "fluent". Please add some AcrylicBrush and RevealBrush brushes to those for a more fluent effect.

SFM61319 avatar Apr 29 '20 14:04 SFM61319

@SFM61319 The discussion of where to use acrylic and where not to isn't really on-topic for this thread - I've moved the discussion over to #1375

zadjii-msft avatar Apr 29 '20 14:04 zadjii-msft

Since the issue https://github.com/microsoft/terminal/issues/3424, asking to be able to disable paste on right-click, was closed as a duplicate of this issue, I would like to bring that up as a separate issue (that is much easier to address) here. PLEASE allow me to disable this functionality in the settings.

I am constantly accidentally pasting my clipboard into the terminal while trying to do something else, which is going to force me to switch back to ConEmu where I can disable this functionality. Since there's already settings for copy on select and key bindings for copy-paste, please please please make this feature turn-off-able too.

helenol avatar May 11 '20 12:05 helenol

So, we're tracking the ability to fully customize what happens when you click in #1553. As part of that work, we'll of course make sure you can turn off all right-click actions.

DHowett-MSFT avatar May 12 '20 01:05 DHowett-MSFT

There is another issue related to this that I think is even more important than neat features: right-click paste can be dangerous or even catastrophic when working in a source-code environment -- I just had it happen to me that a series of lines pasted into a command window (which is why I did a search and found this issue) -- I'm very glad it is on the table. I'm just glad the (unintentional) paste didn't delete or alter any files. (This would be a really insidious way for a hacker to ruin a PC too with the right commands snuck onto the clipboard.) I am aware there is a way to warn before multi-line pasting, which is what I am going to look up now.

In any case, I wanted to reinforce the importance of this one: I believe it is critical to making Windows Terminal safe to use in a source-code environment, where I would very much like to prevent any pasting unless I hit Shift-Ins or Ctrl-V or other bound key sequence to do it. Thanks!!

vwheeler63 avatar Aug 10 '20 17:08 vwheeler63

right-click paste can be dangerous or even catastrophic when working in a source-code environment

Good to know. Hadn't considered that!

I am aware there is a way to warn before multi-line pasting, which is what I am going to look up now.

MobaXterm will warn you if there's an Enter (or newline) included in the paste that might cause the resulting line to execute.

jdrch avatar Aug 10 '20 17:08 jdrch

I'm excited by Terminal. But I'm not willing to use it until I can disable right-click paste. I don't want to dump a bunch of unknown text or commands into a live terminal just because of a stray mouse click.

juvtib avatar Aug 31 '20 17:08 juvtib

I'm excited by Terminal. But I'm not willing to use it until I can disable right-click paste. I don't want to dump a bunch of unknown text or commands into a live terminal just because of a stray mouse click.

I did find something that mitigates this problem enough for me to start using it: the global setting

"multiLinePasteWarning": true,

at least prevents any commands from executing unintentionally, since it looks for line-feeds in the clipboard contents and requires a confirmation before it pastes. However, I'm anxious to see an ability to turn paste-on-right-click feature off or ONLY paste with Ctrl-Ins or other configured key mappings.

vwheeler63 avatar Aug 31 '20 18:08 vwheeler63

"multiLinePasteWarning": true, is not a fix for me cause I am often pasting multi-line text into VIM.

mangelozzi avatar Sep 07 '20 12:09 mangelozzi

I wonder where the right-click-immediately-pastes behaviour originally started? The same behaviour is present in Visual Studio Code's integrated terminal in Windows, but not in Linux.

drewhemm avatar Sep 07 '20 16:09 drewhemm

I wonder where the right-click-immediately-pastes behaviour originally started? The same behaviour is present in Visual Studio Code's integrated terminal in Windows, but not in Linux.

I know it from Console Window Host. Right-click paste has been the default option there for as long as I can remember. But all console shortcuts have a shortcut property that allows you to disable 'Quick Edit Mode'. I assume the Terminal team picked the default behavior to start with.

juvtib avatar Sep 07 '20 19:09 juvtib

An right click menu like linux terminal would be amazing! It would avoid accidently pasting stuff and it would make it more conveinient to copy and paste stuff into the terminal.

TheEpicFace007 avatar Nov 05 '20 16:11 TheEpicFace007

any alternative for this?

lobosan avatar Dec 26 '20 22:12 lobosan

@mdtauk Which other terminal apps have that feature? Just curious. Most multiplexing is done server-side via byobu, tmux, or something similar.

  1. Splitting screen is super useful to me, I do it all the time in daily work, especially we now have large monitorers.
  2. I only use tmux/byobu when I have to, e.g.: on server, since a lot of functions are inconvenient with them, such as copy & paste, scrolling, mouse, etc.
  3. I normally work on Ubuntu with Terminator, the main reason is because is has Horizontal Split and Vertical Split plus icons in right click context menu. Having them in menu is helpful so I don't need to remember the shortcuts. Having the icons is also helpful, since when you say "Horizontal Split" (or "Vertical Split") , it is actually confusing: are you spliting a new window in the horizontal direction(口|口), or you mean the split line is is horizontal (曰)? The icons make you understand it without thinking.

guoqiao avatar Jul 22 '21 11:07 guoqiao

It would be really nice to be able to right-click a pane to close it from a context menu.

ghost avatar Feb 17 '22 02:02 ghost

misc notes from last week:

  • Some of these actions should only appear when text is selected.
    • how?
    • How do we feed the selected text into the action in the menu?
    • There are some notes in #5916
  • I want to be able to right-click search for some text, but again, that requires parsing the action at time of invoke, because the action name would be dependent on the selected text? (some notes in #10175)
  • I want to be able to right click a selection and save that as a sendInput action with that text. That's crazy.
  • "Open Current Directory" or "Copy current path" actions would require that a path had been set by the shell

Actions that could be here:

  • Always:
    • duplicate tab
    • split pane
    • paste
  • Without a zoomed pane(?)
    • zoom pane
  • With text selected:
    • Find this text in the buffer
    • Search the web (requires #10175)
    • Copy
    • #12857
    • Bookmark selection, #11000
  • When there's a path provided by cmdline app
    • Open in explorer
    • copy current path
  • When the connection is closed(?)
    • Close pane #12849 (only mentioned because it's a conditional KB. May want to just always have.)

More notes, circa late june 2022

  • Is it valuable at all to have this be configurable? Other than just "right click opens the menu" - I reckon it might not
  • We could just raise an event from control->app ContextMenuRequestedArgs { selectedText, currentDirectory, connectionState(?) }, then have the app build the menu using that info.
  • This doesn't seem like something that should be an action
  • Without real mouse bindings, I'd put this under "experimental.mouseRightClick": "paste"| "menu"

zadjii-msft avatar Mar 28 '22 19:03 zadjii-msft