Closed MattiasFestin closed 6 years ago
Agreed, this feedback is more general Windows cmd.exe than bash-specific. Here's a workaround to make copying and pasting easier for you:
Launch cmd.exe
Right click title bar, click Properties
Options Tab
Enable QuickEdit mode
Now you can highlight text with your mouse cursor, right click to copy, right click again to paste.
Agreed, this feedback is more general Windows cmd.exe than bash-specific
That's not entirely true, by default the new cmd.exe accepts text pasted with CTRL + V, it's only once you're in bash mode you can't paste anything with CTRL + V (not even CTRL + Shift + V like in Ubuntu terminal).
That's just an option in the properties (Enable shortcuts with Ctrl
or something like that, my interface is not in English :) )
I think using the Ubuntu Style Ctrl-Shift-C would make sense, especially as Ctrl-C is a common interrupt
I'd also like to see things like emacs mode honoured where Ctrl-A / Ctrl-K work as expected
AFAIK Ctrl+A and Ctrl+K already works as expected.
@mobluse So they do. They didn't work for me the other day though, odd.
I think using the Ubuntu Style Ctrl-Shift-C would make sense, especially as Ctrl-C is a common interrupt
My toughs where the same with the Ctrl-C (and also Ctrl-V, not that common) interrupt signals.
That is why I suggested Ctrl + insert and Shift + insert. They work in windows now, so it is nothing new. And they are compatible with the Linux keyboard interrupts.
I vote for Ubuntu terminal shortcuts Ctrl + Shift + C/X/V
as a primary ones and maybe an alternative Ctrl/Shift + Insert
. But that's only my preference because I use bash on Linux in most cases.
Why not to provide a way to configure the terminal shortcuts for this app? I'm not a win user, i'm just reviewing it
If not, @mirao proposal +1. I'm a *nix user in most cases too, and would be great maintain the default terminal shortcuts for the major distros.
I would like to have CTRL + Shift + C/X/V, although if possible my vote would be for it to be configurable.
This is a current limitation in the Windows Console.
Console currently supports two input modes: 'processed' and 'raw'. In 'processed' mode, Windows Console pre-processes all keystrokes, handling several well-known chords consistently across cmd, PowerShell and elsewhere.
To better handle NIX behavior, however Bash requests raw, un-pre-processed keyboard input. We do have a task on our backlog to add a "mildly-pre-processed" mode wherein Console will translate copy and paste key chords into the VT sequences expected by NIX tools, shells, etc.
You can run REG.EXE add HKCU\Console /v QuickEdit /t REG_DWORD /d 1 /f
as administrator in the Windows Command Prompt to enable QuickEdit by default.
This would let you:
To disable QuickEdit run REG.EXE add HKCU\Console /v QuickEdit /t REG_DWORD /d 0 /f
as administrator in the Windows Command Prompt to disable it by default.
I just installed "Bash on Windows" and I can copy / paste by doing
ctrl+shift+c ctrl+shift+v is what is preferred
Here's another vote for Ctrl+Ins/Shift+Ins. This seems to be the standard for TTY apps, which is how I usually interact with Linux when in Windows.
+1 to Ctrl-V or some variant. Right clicking to paste works, but taking my hands off the keyboard is far from ideal.
I agree that this should be configurable.. I, for one, would like to have either CTRL+SHIFT+C/X/V
or ALT+C/X/V
(to simulate how things are done in Mac; the Command + C/X/V
)... Also, it would be preferable to configure the "right click" behaviour as I'd expect it to give me a menu (to copy/cut/paste.. etc) as opposed to the "right click to paste" behaviour.. This is especially noticeable when using VIM.. ☹️
Suggest seeing these uservoice requests in addition to upvoting here:
Another vote for gnome-terminal style cut and paste.
The main problem is that it is using the Windows Console app, which, at least from a linux guy, sucks, and always has.
If you really want to cater to linux folks, you need a much better terminal emulator.
mouse right click is not better than ctrl+shift+c\v.hope ASAP to support this function.
There is a workaround to the WSL Bash, paste issue:
One can simply do the following steps:
The bash will exit after the command, I don't know how, yet, to keep it running after, like, "variable assign" from the cmd console. e.g. 'bash -ic "command and remain'
So @bitcrazed this is in you guys backlog right? Any expectation on release date/time? Coming to a next major version or just simple Windows Update?
I actually "assumed" this would be solved with the Creators Update, and to my surprise it's not actually there. So wondering if we're expecting a time frame in years or in weeks lol
Agreed; @bitcrazed some sort of release timeframe would be awesome.
I was unpleasantly surprised that Bash on Windows doesn't support Shirt-Insert
shortcut. This missing feature is the one that preventing me from switching from the Cygwin. Hope it will really be implemented soon.
@plagov You could use WSLTTY to get Shift+Insert now: https://github.com/mintty/wsltty
@mobluse just installing wsltty-0.7.6-install.exe
and that's it?
Installed it, but still, Shift-Insert
doesn't work. Or some extra configuration is required?
@plagov I think I didn't configure it, but it can be configured in Options/Keys (Alt+Space O Shift+Tab K).
Another vote for Ctrl-Shift-C and Ctrl-Shift-V copy/paste style.
This is a really critical issue. Can you prioritize please?
I already installed ConEmu to workaround this issue but ConEmu's bloated pseudo-feature set is just broken-by-design in so many other ways...
For now, I have been working around the issue with the following AutoHotkey script:
#IfWinActive, ahk_class ConsoleWindowClass
^+v::Rbutton
#ifWinActive
@sgoranson I've installed https://autohotkey.com/download/ compiled your-script.ahk
and started the created your-script.exe
file but still Bash keeps receiving ^V
.
What actually worked for me, was:
#IfWinActive ahk_class ConsoleWindowClass
^V::
SendInput {Raw}%clipboard%
return
#IfWinActive
@loxal Good call. My version will do annoying things if the cursor is not over cmd.exe.
If anyone wants to use loxal's script with ConEmu, just change ConsoleWindowClass to VirtualConsoleClass
Personally, I prefer cmd.exe because it has far fewer issues for me with color and control characters. For example, I could not get CTRL-W working in ConEmu VIM, so I couldn't switch windows.
Please do it! I can't click right always to paste. This is not how it should be. Using Bash on Ubuntu on Windows
Isn't this something that should come out of box and without requesting. Also I find but heck they don't work!
@nimitbhargava - Thanks for your feedback. Here is the user voice ticket for this. Please upvote to help the console team prioritize it.
@loxal for me the script didn't work. Indeed, the pasted data replaced `
characters or dashes.
I had to change it by
#IfWinActive ahk_class ConsoleWindowClass
^V::
MouseClick, right
Return
#IfWinActive
The community can debate ctrl+c/v variations as much as needed. But I feel that the faithful paste method of Shift+Insert should function as it does in every other terminal application.
Using Ctrl+A as an alternative to Ctrl+C is awful because it conflicts with the Bash Ctrl+A/E beginning/end of line cursor placement shortcuts which are huge timesavers when repeating/modifying long commands. Ctrl+A would break that feature.
I have the same problem ... CTRL+Insert and SHIFT+Insert will not work and also CTRL+SHIFT+c/v does not work. I need to use the mouse to paste and this is incredibly annoying. Only one way to copy paste. At the same time most of the other functions work.
wsltty is a great suggestion for enabling keyboard shortcuts for copy/paste for wsl (and it uses the sensible CTRL/SHIFT+INSERT shortcuts). It will also enable ALT-SPACE to select the window menu (and if you use it for nano or other things that depends on it you can still turn it off from a simple option panel).
However, it does not provide the nice text selection features (SHIFT-ARROW keys to select text) that the console has (and that it "loses" under wsl) 😢
Vote up +1 Please
Vote up +1 Please
We're very (painfully!) aware of this ask.
Sounds like it'd be the simplest feature to implement, right? I mean, how hard could adding a handler for CTRL+SHIFT+V be? Turns out there be dragons in the Console's keyboard handling stuff that has been under heavy re-architecture of late, so haven't had spare resources to work on this. YET!
We beg your continued patience - we'll get to this ASAP.
/cc @tara-raj @zadjii-msft
Glad to hear this is high on the to-do list!
Imagine - we live in the command-line, Console and WSL all day long, every day, and we still haven't gotten around to implementing paste - we feel your pain ;)
In Command Prompt, it do have an Shift + Insert
keyboard shortcut to execute paste. The same keyboard shortcut is used on common linux terminal too. So I vote for using the same keyboard shortcuts shift + insert
by default for WSL terminal.
Thank you very much @sgoranson and @loxal, here are the scripts that worked for me (ctrl+shift+v and ctrl+v), the program(AutoHotkey) also supported the option to create .exe files, this allows to skip the installation of the complete software, there are also included in the zip, regards!
PD: Here is a bat file to run the exe on start
@echo off
SET bashPaste=your path to exe here
rem add on start
@reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run" /t REG_SZ /v "bash paste" /d "\"%bashPaste%\"" /f
pause
@echo off
rem remove
@reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run" /v "bash paste" /f
pause
Vote up +1 Please
Unlike other folks, I’d prefer to have Ctrl+C
/Ctrl+V
just like CMD and PowerShell have. I switch between PowerShell and Bash frequently, and having different copy-paste shortcuts would require me to think each time I’m trying to paste something.
Ctrl+C
does have a special meaning, but we could handle it just like PowerShell does. I.e. if no text is selected, it sends SIGING
; if some text is selected, it copies it (without sending SIGING
) and resets the selection.
@iamakulov That's actually how copy works in WSL at the moment. If you have text selected, C-c will copy it.
@zadjii-msft Right, good point! So only Ctrl+V
is to be implemented then.
It would be nice to have keyboard shortcut for pasting into console instead of right clicking (Or window menu -> edit -> paste).
I tend to use my keyboard as much as possible. So it would be nice to have a shortcut like git bash: