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

Keyboard shortcuts for copy / paste into console #235

Closed
MattiasFestin opened this issue Apr 20, 2016 · 81 comments
Closed

Keyboard shortcuts for copy / paste into console #235

MattiasFestin opened this issue Apr 20, 2016 · 81 comments
Assignees
Labels

Comments

@MattiasFestin
Copy link

@MattiasFestin MattiasFestin commented Apr 20, 2016

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:

  • copy = ctrl + insert
  • paste = shift + insert
@benhillis
Copy link
Member

@benhillis benhillis commented Apr 20, 2016

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.

@Birssan
Copy link

@Birssan Birssan commented Apr 21, 2016

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

bash-copy

That's just an option in the properties (Enable shortcuts with Ctrl or something like that, my interface is not in English :) )

@mgleadow
Copy link

@mgleadow mgleadow commented Apr 22, 2016

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

@mobluse
Copy link

@mobluse mobluse commented May 1, 2016

AFAIK Ctrl+A and Ctrl+K already works as expected.

@mgleadow
Copy link

@mgleadow mgleadow commented May 3, 2016

@mobluse So they do. They didn't work for me the other day though, odd.

@MattiasFestin
Copy link
Author

@MattiasFestin MattiasFestin commented May 10, 2016

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.

@mirao
Copy link

@mirao mirao commented Jun 4, 2016

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.

@XaviTorello
Copy link

@XaviTorello XaviTorello commented Jun 4, 2016

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.

@GrimTheReaper
Copy link

@GrimTheReaper GrimTheReaper commented Jun 20, 2016

I would like to have CTRL + Shift + C/X/V, although if possible my vote would be for it to be configurable.

@bitcrazed
Copy link
Contributor

@bitcrazed bitcrazed commented Jul 3, 2016

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.

@ghost
Copy link

@ghost ghost commented Aug 8, 2016

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:

  • copy text by highlighting text (left clicking) and then right clicking.
  • paste text by right clicking

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.

@Pixinn
Copy link

@Pixinn Pixinn commented Aug 15, 2016

I just installed "Bash on Windows" and I can copy / paste by doing

  • CTRL + SHIFT + C
  • Right Click
@brnelsons
Copy link

@brnelsons brnelsons commented Oct 18, 2016

ctrl+shift+c
ctrl+shift+v
is what is preferred

@konnichimade
Copy link

@konnichimade konnichimade commented Oct 18, 2016

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.

@jskopek
Copy link

@jskopek jskopek commented Oct 28, 2016

+1 to Ctrl-V or some variant. Right clicking to paste works, but taking my hands off the keyboard is far from ideal.

@farahfa
Copy link

@farahfa farahfa commented Oct 28, 2016

I agree that this should be configurable.. I, for one, would like to have either CTRL+SHIFT+C/X/Vor 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.. ☹️

@brennanmh
Copy link

@brennanmh brennanmh commented Feb 6, 2017

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.

@TestSmirk
Copy link

@TestSmirk TestSmirk commented Mar 7, 2017

mouse right click is not better than ctrl+shift+c\v.hope ASAP to support this function.

@n3rd4i
Copy link

@n3rd4i n3rd4i commented Apr 1, 2017

There is a workaround to the WSL Bash, paste issue:

One can simply do the following steps:

  1. open cmd.exe
  2. bash -c "pasted command here" ( this works because you are in cmd.exe )

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'

@florianmonfort
Copy link

@florianmonfort florianmonfort commented Apr 13, 2017

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

@kavdev
Copy link

@kavdev kavdev commented Apr 17, 2017

Agreed; @bitcrazed some sort of release timeframe would be awesome.

@plagov
Copy link

@plagov plagov commented Apr 19, 2017

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.

@mobluse
Copy link

@mobluse mobluse commented Apr 19, 2017

@plagov You could use WSLTTY to get Shift+Insert now: https://github.com/mintty/wsltty

@FredyC
Copy link

@FredyC FredyC commented Mar 15, 2018

Ah, I see now, that works indeed, but honestly, it might be just faster to grab that mouse and click instead of cycling through all windows with Win+T :)

It seems you don't even need to click on corner icon, right clicking on titlebar works and then you just hit E + P and done. Definitely easier :) Only wish it would be some other letters as to hit P I have to move away from mouse ... oh well.

@jesseconnell
Copy link

@jesseconnell jesseconnell commented Mar 15, 2018

"might be faster to grab that mouse..." Oh right! That's a great workaround - I suggest closing the issue. :trollface:

@xdfil
Copy link

@xdfil xdfil commented Mar 16, 2018

@zerocool4u2
Copy link

@zerocool4u2 zerocool4u2 commented Mar 16, 2018

Hi, three months ago I posted a zip file with scripts for a workaround on ctrl+v and ctrl+shift+v on console, they are really easy to use and honestly they are the more easy workaround I found, thanks again to @sgoranson and @loxal who share how to do this before me.

  1. choose an exe file from the zip, ctrl or ctrl+shift
  2. test it on bash, you will also get a tray icon to know that it is open, if everything works go to step 5
  3. something went wrong or you are using another shell, install autohotkey and edit the files with extension ahk, above are comments about this that might be helpful
  4. if you don't want an extra program on your system, you can compile your code to an exe file on autohotkey and uninstall it
  5. everything working? perfect add it to a startup program, to not have to open it every time.
  6. here are some bat files to do so
@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
  1. when this is officially implemented, here is the bat to clean the startup program
@echo off

rem remove
@reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run" /v "bash paste" /f
pause

I know that is annoying to not have it natively yet, but I'm sure there is a good reason behind it, I share the sentiment of @xdfil if you are a hardcore DevOps or a Pentester, they are a lot of important things that are not implemented yet, but for others who work on back ends like rails for example or many many others fields, this is a game changer, my life has been a lot easier for the past 2 years (06-2016 I believe), when pretty much all I need it was working as expected, been able to not have to jump between OS's is priceless for me, sincerely. Nowadays, I love my console, It could be better?, sure, but every patch I found something new to take advantage and hopefully soon, everything would work and I will be able to hack my neighbor with aircrack.

My current console after some tweaks

imagen

@zadjii-msft
Copy link
Member

@zadjii-msft zadjii-msft commented Mar 20, 2018

No need for people to get salty, a little patience goes a long way:

image

Just checked it in. See y'all in skip-ahead.


Before people ask, there is a plan in play for more customizable and configurable keyboard shortcuts, but that's more than a release away from here. This is a stopgap until we can complete that work.

@loxal
Copy link

@loxal loxal commented Mar 21, 2018

Nice but when can we expect this feature in the Windows release? Many people got salty because this most basic feature is supported in macOS since a decade whereas Windows took "a bit" longer. Legacy should not be an excuse. I suppose that macOS had to solve similar problems and legacy implementations can be always resolved with explicit opt-in implementations.

@zadjii-msft
Copy link
Member

@zadjii-msft zadjii-msft commented Mar 21, 2018

The next full release of Windows with this enabled will be whatever comes after Spring Creator's Update (2Fall2Creators Update?).

@bitcrazed
Copy link
Contributor

@bitcrazed bitcrazed commented Mar 21, 2018

@loxal & @ALL

We understand the frustration - we feel it all day too because, unsurprisingly, we all live in the Console all day long.

However, simple physics have prevented this feature from bubbling high-enough up our prioritized bug list to receive attention until recently: Console has a small team of 3 who've been working at breakneck speed to add the MANY feature improvements you've all seen over the last 2+ years, adding masses of VT support, 24-bit color, etc. while re-engineering & modernizing a complex 30+ year old code-base.

Legacy may not be an excuse in your mind, but it's a reality that's unavoidable. If we "break" the Console's existing Windows behaviors, we hear from 1000x more users than if we "break" a Linux user's workflow.

So, understand if there's an issue that appears to be "simple to fix" and it hasn't been, then it's safe to assume that there's a very good reason it's not yet been fixed, frustrating though the delays may be at times.

We greatly appreciate everyone's continued patience and continued feedback & encourage y'all to keep it coming: It helps us find & fix the issues that matter in a sane prioritized order.

@kavdev
Copy link

@kavdev kavdev commented Mar 21, 2018

"Legacy should not be an excuse"

@loxal That's actually a pretty damn good excuse in my book. A small team trying to modernize 30+ years of legacy code is a massive undertaking. I wouldn't wish it upon my worst enemy lol

Just think of how many global enterprise users of windows there are. Breaking compatibility in something so foundational as the console framework would be an SLA nightmare.

It's a lot to ask from all of us, but patience is key here. I think we're just all glad to see bash make its way into windows in the first place; look at how far we've come in 2 years!

All that said, @bitcrazed: do you see the Console team getting more resources any time soon or are you guys at optimal stride with 3 people?

@zadjii-msft
Copy link
Member

@zadjii-msft zadjii-msft commented Mar 21, 2018

do you see the Console team getting more resources any time soon or are you guys at optimal stride with 3 people?

@kavdev I don't think resource allocation is really something any of us on the Console team are at the pay scale to discuss. I think we'd all love to have more resources, more devs, to be able to churn out more features. Obviously, though - we're all on this team because of how passionate we are about it so of course we want more resources to be able to deliver more features.

It probably doesn't help that we keep rocking it with only 3 devs - what other team has that kind of feature/dev ratio? 😝

@WSLUser
Copy link

@WSLUser WSLUser commented Mar 21, 2018

Idea here: Open-source the console. If Microsoft doesn't want to hire more console devs, then get devs to do it for free! Pretty sure there's been enough enthusiasm gone around to get a bit of help. Of course to avoid legal hassle, they'd probably have to reduce the cost of the OS by X amount since they probably wouldn't want to compensate anyone for their service to a product that they sell that uses the work. Probably still much more complex than that but they've open-sourced Powershell and there's VS Code..plus you've got the ColorTool which is open-source. I would think it's less of a stretch to open-source the console than it is to open-source WSL or especially Windows (as great as that would be) but who knows? Maybe it IS a big stretch in MS's mind.

@bitcrazed
Copy link
Contributor

@bitcrazed bitcrazed commented Mar 21, 2018

@DarthSpock Open-sourcing the console is something we discuss regularly. While it's not on the cards in the near term, it's not entirely out of the realm of possibility. One of the biggest challenges, however, is that the Console is FARRRRR from being in a useful shape for others to rapidly comprehend and contribute to in a meaningful way. Even internally!!

As @zadjii-msft points out above - we'd love to have "some more dev resources" on the team, but at the same time, be they full-time employees or community contributors, additional resources will decrease productivity of an established team - a team who've spent the last 3 years unpicking and understanding, and mastering every corner of a large, old, messy, confusing, but utterly essential code-base.

And as @zadjii-msft points out - though it may not be apparent from the outside - the 3 devs we have keep overachieving in every release. Maybe if they struggled and complained more, we might get more resources.

We'll bear that strategy in mind for the future ;)

@bitcrazed
Copy link
Contributor

@bitcrazed bitcrazed commented Mar 21, 2018

@kavdev - many thanks :)

We're excited to come into work to improve the Console in tiny/unmeasurable, huge/significant ways each and every day. We're all passionate command-line nerds and do this work because we believe Windows users (including us) deserve a kick-a$$ command-line experience. We'll get there - just stick with us while we wrestle this beast into shape :)

@FredyC
Copy link

@FredyC FredyC commented Mar 21, 2018

It must be a really amazing experience to be on such team, sounds like a well-oiled machine so to speak. Keep up great work!

@renzok
Copy link

@renzok renzok commented Mar 21, 2018

@bitcrazed
Copy link
Contributor

@bitcrazed bitcrazed commented Mar 22, 2018

@FredyC & @renzok - It is genuinely humbling to work with the awesome WSL and Console engineering teams, and with so many of you in the community. I've learned SO MUCH in the last couple of years and continue to do so daily.

We're like swans - we appear calm and collected up-top, but are paddling like fury underneath 😁

@bitcrazed
Copy link
Contributor

@bitcrazed bitcrazed commented Apr 13, 2018

Excited (relieved?) to finally be able to announce that this issue is now fixed (by @zadjii-msft)! Copy and Paste arrives for Linux/WSL Consoles

Marked as fixed in insiders build 17643. Will ship in Win10 18H2 release.

Closing since the work is now done.

@bitcrazed bitcrazed closed this Apr 13, 2018
@Pixinn
Copy link

@Pixinn Pixinn commented Apr 14, 2018

That's a great news! Thanks for all the hard work! 👍

@shamoons
Copy link

@shamoons shamoons commented Jun 12, 2019

I don't know if this is fixed. I have 1903 and in my Ubuntu bash, CTRL+SHIFT+C/V works, but within WSL for VS Code, it does not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet