Remix.run Logo
j1elo 3 days ago

Work had me using the Windows Terminal for the first time ever after a life of developing on Linux. I got immediately hooked on the smart Ctrl+C and Ctrl+V (without needing to use Shift like on Linux!)

For those not knowing, Windows Terminal uses Ctrl+C to abort the current process (as we'd expect) when nothing is selected, but copies when there is a selection. Similarly, Ctrl+V just pastes. So convenient!

cosmic_cheese 3 days ago | parent | next [-]

Mac terminals yield a similar benefit, with the systemwide copy/paste Cmd+C/V not overlapping with Ctrl+C/V.

Being used to that, Linux terminals become rather annoying. Yes there's other ways under Linux, but they don't have 25+ years of muscle memory associated with them, and so when the key shortcuts don't work as expected it's like nails on a chalkboard.

jack_pp 3 days ago | parent | next [-]

Heh, shortcut muscle memory is the reason I returned my Mac mini one week after trying it. I sure am not gonna remap my brain for apple after 20 years of Linux and windows.

nsagent 2 days ago | parent | next [-]

Maybe you mean it's too much effort, because I'm sure you could. I was taught touch typing on a QWERTY keyboard in the summer between 6th and 7th grade. Last year I switched to Colemak after nearly 30 years of QWERTY.

jack_pp 2 days ago | parent [-]

Oh I have no doubt that I could but I don't see why since linux already does what I need and I don't see any compelling reason to switch. I was just curious to see what all the hype was about with the new m1 CPUs and give it a shot.

computably 3 days ago | parent | prev [-]

It's easy and reasonably quick to set up key remapping (via Karabiner).

taftster 3 days ago | parent [-]

Yes, but specifically in the context of Terminals (as discussed in the original article), it's really convenient to be able send Ctrl-C (break) differently than Cmd-C (copy).

So yes keyboard remapping is an option. But there's just differences you can't remap because of the extra meta keys on Mac (and I guess on Windows too, with the Copilot or Start keys in play).

inejge 3 days ago | parent [-]

> it's really convenient to be able send Ctrl-C (break) differently than Cmd-C (copy)

Right, and even on Linux you can do it by using the four-fifths forgotten CUA shortcut Ctrl-Insert for copy (and Shift-Insert for paste.) Although I'll admit to using Ctrl-Shift-C/V most of the time.

Ghoelian 2 days ago | parent [-]

My keyboard doesn't even have an insert key.

kps 2 days ago | parent | prev | next [-]

There are *nix terminals that will let you bind shortcuts that don't conflict with terminal control keys. Konsole and KDE stuff in general will let you set Mac-style bindings (with some config effort), though I personally use mlterm.

sunshowers 2 days ago | parent | prev | next [-]

The tradeoff here is that Macs don't have a system key that most applications don't interpret in some way. On Windows and Linux, system key shortcuts are much easier to set up.

taftster 3 days ago | parent | prev [-]

I really do like Cmd key usage for any terminal in Mac. The ability to send Ctrl+C differently than Cmd+C in a Mac is joyous.

However, for most all other applications in Mac, I dislike the Mac command key. Especially in IDEs like vscode, etc.

And I really hate that the actual Ctrl key on a Mac is in the wrong place, having swapped places with Fn. It's like the first thing I have to remember to do on each Mac setup, swap those two keys.

Because I'm toggling between mac/windows/linux all day long, my poor muscle memory is always confused. And it would be nice if this could be unified. Unfortunately, I'm guessing it would have to be solved more by Apple than by Microsoft or Linux.

kace91 2 days ago | parent | next [-]

What do you dislike about cmd placement?

I feel the opposite, the near-thumb position for the most used modifier is a godsend vs pinky strain.

Ctrl in caps lock is debatably better but that key is arguably better used for esc in vim setups (or the harder to setup “ctrl if held, esc if tapped”).

phantasmish 2 days ago | parent [-]

cmd is brilliant. I have to shift my entire hand downward a little to hit ctr+c/ctrl-v, and make a pinkie-stretch that I can feel straining my hand. Cmd+c/v keeps three fingers on the home row, and involves just a slide-over of the thumb by maybe a centimeter. It's great.

caps-as-an-extra-ctrl helps with all of that, but leaves you with the problem of overlapping shortcuts in the terminal. Cmd also fixes that.

I hate how hard it is to get anything remotely like it working in Linux. All the solutions are partial and very janky.

cosmic_cheese 2 days ago | parent [-]

It’s a sentiment I’ve expressed many times here on HN, but I’d love to see a DE and matching set of apps designed to embrace Mac-like UX, including meta-based key shortcuts. It being like that out of the box instead of requiring a patchwork of spotty config changes and hacks brings massive value.

kace91 a day ago | parent [-]

This is the closest thing I know, not ideal but decent:

https://github.com/RedBearAK/Toshy

cosmic_cheese 3 days ago | parent | prev [-]

On all my machines I remap Caps Lock to Control, and since I still use Control from time to time under macOS, I have muscle memory for it, and so switching between Control/Command dominance is low friction.

Control in its typical position however drives me crazy.

Yizahi 2 days ago | parent | prev | next [-]

I really wish PC manufacturers didn't kill Insert button. It worked just fine for decades with Ctrl-Ins/Shift-Ins, and in every terminal I've tried. But now the button is missing more and more often (thanks HP, I appreciate useless call and share buttons in its place, which don't work anywhere), and fixes need to be invented for a solved problem.

indigodaddy 2 days ago | parent [-]

Yeah shift-ins really is the way

h3x4d3c4 3 days ago | parent | prev | next [-]

Not sure if this was available from the beginning, but Ghostty has the ability to do exactly that with what they call "performable" keybindings

<https://ghostty.org/docs/config/keybind#performable:>

ghosty141 2 days ago | parent | next [-]

Oh wow, I'm already using ghostty and didn't know about this. It works great, thanks!

ur-whale 2 days ago | parent [-]

Ooh, seconded, will try right away.

[EDIT]: so ... tried it ... very, very nice BUT:

what of CTRL-V ???

ghosty141 2 days ago | parent [-]

You can do the same with ctrl+v, just use paste_from_clipboard

ur-whale 2 days ago | parent [-]

> You can do the same with ctrl+v, just use paste_from_clipboard

Yeah, but CTRL+V is actually used e.g. in VIM.

And I can't see a way for ghostty to "guess" what to do based on context like it does in the case something is selected.

Sorry, should have explained better.

mongol 3 days ago | parent | prev [-]

Hope Kovid Goyal gets inspired by this

h3x4d3c4 2 days ago | parent [-]

Kitty also has it, I didn't know prior to today

https://sw.kovidgoyal.net/kitty/conf/#clipboard

mongol 2 days ago | parent [-]

fantastic!

teo_zero 2 days ago | parent | prev | next [-]

It doesn't look so convenient to me. If Ctrl+v is bound to paste, how do you insert a verbatim character in the shell? How do you start a block visual selection in Vim? How do you scroll down in emacs?

throw0101c 2 days ago | parent | next [-]

> If Ctrl+v is bound to paste, how do you insert a verbatim character in the shell?

For those unaware:

> Unix interactive terminals use Control-V to mean "the next character should be treated literally" (the mnemonic here is "V is for verbatim"). This allows a user to insert a literal Control-C or Control-H or similar control characters that would otherwise be handled by the terminal. This behavior was copied by text editors like vi and Unix shells like bash and tcsh, which offer text editing on the command line.[3]

* https://en.wikipedia.org/wiki/Control-V

blueflow 2 days ago | parent | prev | next [-]

You don't but you don't notice if you never did anything like that. Half of the keybinds listed by 'stty -a' are a mystery to mankind.

tom_ 2 days ago | parent [-]

You can unbind the Ctrl+V keymapping if you want, and it behaves as expected in emacs -nw at least. (There's a Ctrl+Shift+V binding set up by default, same as many Unix terminal emulators, so you won't miss out.)

j1elo 2 days ago | parent | prev [-]

Seems to me a reasonable concern but I'd bet it's only for a minority of users... so perfect candidate to have implemented, but given as a disabled by default setting.

stefanha 3 days ago | parent | prev | next [-]

In Linux (Wayland) you can copy text from the terminal without pressing Ctrl+C at all. Just select the text. To paste it in another Window, press the middle mouse button.

This is called the Primary Selection and is separate from the Clipboard (Ctrl+C/Ctrl+V). IMO the Primary Selection is more convenient than the Clipboard.

pmontra 3 days ago | parent | next [-]

That's an X11 thing that Wayland had to reimplement because it's so convenient. The problem is when pasting into the terminal something that another program copied into the clipboard. That's ctrl-shift-c.

I thought about remapping copy and paste to their own keys, possibly a single one. Maybe on the number pad, which I never use. Or remapping ctrl-c.

tmtvl 2 days ago | parent [-]

There's always Ctrl+Insert for copy and Shift+Insert for paste. I know that there's some laptops lacking an insert key, which is terrible, but for keyboard with an insert key the Ctrl/Shift + Insert combos are useful at times.

pmontra 2 days ago | parent [-]

Especially because one does not have to push three keys with the same hand, which is not nice to tendons. I think I did that for a while time ago, then forgot about it. Thanks.

tmtvl 2 days ago | parent [-]

I always use the opposite modifier key(s) (e.g. right control + a), which I was told to do when I learned to type Dvorak; but you're welcome.

DaSHacka 3 days ago | parent | prev | next [-]

Isn't this an X11-ism? I dont believe this is Wayland-specific

j1elo 3 days ago | parent | prev | next [-]

Yeah I know. I missed this for the first couple days, but didn't take much before forgetting it after the change to Windows. (anyway I keep using Linux at home)

lelandbatey 3 days ago | parent | prev | next [-]

This is also a thing in X, not only Wayland.

dzaima 2 days ago | parent | prev | next [-]

But that doesn't go into clipboard history. And severely restricts what you can do between copying and pasting in general (very importantly makes it a pain to do replace (i.e. select+(implicit-delete+)paste)) as any intermediate selection before pasting destroys your Primary Selection. And if you realize you did that, recopying takes manually reselecting the text, or the otherwise-never-used ctrl+insert to recopy, instead of just repeating the same old ctrl+c as you always do with the clipboard in any sane application.

Of course still a nice option (esp. in terminals where the proper copy/paste are nerfed and selecting for editing is annoyingly not a thing), but far from a replacement for the proper clipboard.

bytehowl 2 days ago | parent | prev | next [-]

How do you paste the selected text if you want to replace a text selection in the other window?

bluebarbet 2 days ago | parent | prev [-]

>middle mouse button

Speaking for myself (although I suspect many others), I haven't used a mouse in well over a decade. To be clear, I am in the terminal all the time. So this is not a universal solution.

usrbinbash 2 days ago | parent | prev | next [-]

> So convenient!

Running in tmux, marking anything on my terminal immediately puts it into the tmux buffer, without me having to click anything on the keyboard. Pressing middle-mouse pastes it.

THAT is convenience.

rovingeye 2 days ago | parent | next [-]

I have that turned on in Windows Terminal but still use ctrl+c because it's how all other software works

ur-whale 2 days ago | parent | prev [-]

> immediately puts it into the tmux buffer

Can you paste in a non-terminal app though (like a web browser) ?

usrbinbash 4 hours ago | parent [-]

Yes, of course I can. I have a separate binding in my tmux config to copy to the clipboard.

mongol 3 days ago | parent | prev | next [-]

This is genious. It is one of the most annoying things remaining in the Linux desktop and I often press Shift-Ctrl-C in the browser by mistake, opening up the dev tools in the process, while intending to copy.

Are there any legitimate reasons to send Ctrl-C except to abort, that this could interfer with?

jwnin 3 days ago | parent | prev | next [-]

windows terminal is awesome and i wish it shipped with windows by default instead of having to go to the store and install it. everyone who uses it has only good things to say, and it is updated regularly by Microsoft.

DHowett 3 days ago | parent | next [-]

It comes with Windows, and has since 2022! Alas, if you mean Windows 10 then you can use some DISM magic to add it to an install image.

zadjii 2 days ago | parent | prev | next [-]

It's shipped with Windows since Windows 11. Updates come via the Store (since that's a lot faster than OS updates), but it's definitely preinstalled these days

Iwan-Zotow 3 days ago | parent | prev [-]

It is default in w11 25h2

co_dh 2 days ago | parent | prev | next [-]

I have to warning everyone: Windows terminal with true color , possibly with tmux, is very slow. There is a half second delay from key press to response. I am in a vdi. Your miles varies.

ciberado 2 days ago | parent [-]

This doesn't correspond to my experience. The terminal is not faster than light, but good enough for my requirements, and I use it both locally and through VNC. May it be a problem with your VDI setup?

thayne 3 days ago | parent | prev | next [-]

FWIW, in zsh, and probably other terminals, you can bind ctrl+v to be paste. Many terminal emulators also allow you to bind ctrl+v to paste, although that may interfere with applications that use ctrl-v for something else.

Kitty has a copy_or_interrupt action that behaves like you describe. Although, I think it would interfere with apps where ctrl-c is handled specially.

Edit: kitty also has a copy_or_noop action that passes through the ctrl+c if there is no selection.

biehl 2 days ago | parent | prev | next [-]

That sounds like an awesome concept. However, I'm restarting Linux usage after 10 years on Mac, and I am surprised on how much less annoying the Shift-ctrl-v is compared to what I expected.

fithisux 2 days ago | parent | prev | next [-]

Yori is also a very capable replacement.

ajross 3 days ago | parent | prev [-]

> I got immediately hooked on the smart Ctrl+C and Ctrl+V (without needing to use Shift like on Linux!)

You, uh, never tried middle clicking?

ghosty141 2 days ago | parent | next [-]

I mean ctrl+c/v is just muscle memory, obviously there are tons of other way but ctrl+c/v are just the default and the one everyone knows.

ajross 2 days ago | parent [-]

It depends on the semantics of "everyone" and "knows". The X11 selection bindings predate CUA clipboard usage by a few years, actually. But in any case, the contention was that they were simpler, not that they are standard. And they aren't.

nitinreddy88 3 days ago | parent | prev [-]

So now we are moving away from Keyboard only Vim/Terminal thing to mouse for pasting?

pmontra 3 days ago | parent | next [-]

Yeah, that slows down typing a lot. Luckily people on a laptop can use the touchpad which lies just below the space bar. I have a laptop with physical keys around the touchpad so I even have a button to paste. No need to tap, double tap, etc. I think that I never used a mouse in the last 20 years.

ajross 3 days ago | parent | prev | next [-]

You can cut/paste within your editor just fine. The subject at hand is window-system level clipboard/selection interaction, and in particular the presence of standard key bindings for them in various environments. While some terminal and editor apps do have keyboard bindings that interact with the OS clipboard, none are standard.

Basically, yeah: you had to use the mouse to select it in the first place. Using the mouse to paste it is easier, not harder.

officeplant 2 days ago | parent | prev [-]

I can hit the middle click for my Trackpoint without leaving the keyboard :3