In all GUI text editors, web browsers and IDE’s you can move a cursor:
- left/right arrows - move by char;
- ctrl+left/right - move by word;
- home/end - move to start/end of line.
Add Shift to any of above combination and everything you jumped through now is selected and you can: Ctrl+C, Ctrl+X,Delete to copy/cut/delete selection.
Also, you can Ctrl+Delete and Ctrl+Backspace to delete a next/previous word.
Also, you can Ctrl+Home/End to jump to start of first line or end of last line.
I want this to work when I type in a command in my Terminal.
Is it possible in Linux? It’s a vanilla experience in Windows+Powershell, thanks to default PSReadlLine extension. It works both in conhost.exe and in Windows Terminal, but doesn’t work in WT + cmd.exe, which makes me think it’s PSReadLine which is responsible for this technological perfection.
“But you can’t copy with Ctrl+C, it’s…” - You can. When something is selected It copies selection to clipboard, otherwise it sends SIGINT.
I’m not bound to any distro or terminal application, but right now I don’t see these incredible text editing techniques working even in Ubuntu+Powershell+PSReadLine, to say nothing about the Bash. I’ve tried installing WezTerm, but it doesn’t have text selection either, at least by default. And I’m inclined to think it has nothing to do with terminal emulators at all, since it works in conhost.exe+Powershell.


I will paste here my investigations. So far, I’ve tried only Blesh and zsh-shift-select, both in Gnome Terminal. Results are not satisfying: a lot of effort to get 60% of what you want and break 20% of what you had.
Possible solutions
Blesh
https://github.com/akinomyoga/ble.sh/wiki/Manual-§4-Editing
zsh-shift-select
cannot install package alacritty 0.16.1, it requires rustc 1.85.0 or newer, while the currently active rustc version is 1.75.0Fail. Will use Gnome Terminal instead.gnome-shell crashed with SIGSEGV..zshrcI was able to test out what you’re looking for on macos and its default out of the box terminal does copy and pasting with command-c/x/v just like everywhere else in the os. I haven’t tested Unicode, but rich text and other marked up text types get copied with their formatting between editors that support it and as ansi characters when pasted into the terminal. Option (alt) arrow keys jump to the first letter of each “word” and control arrow keys don’t do what you want because at the os level they’re the keys for switching workspaces. Which is really nice and reminds me I need to set up my windows image to do this instead of uhh win-ctrl or whatever it is.
The default macos shell is zsh, so maybe with that shift-select extension you can get it the way you like.
Might be time to switch to a mac!
I’m really surprised that you couldn’t get alacritty working in Ubuntu, it’s been working fine on Debian stable for at least two major versions when installed through apt.