this post was submitted on 29 Oct 2025
137 points (95.4% liked)

Linux

59475 readers
168 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 6 years ago
MODERATORS
 

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.

you are viewing a single comment's thread
view the rest of the comments
[–] podbrushkin@mander.xyz 10 points 1 week ago* (last edited 1 week ago) (3 children)

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-%C2%A74-Editing

  • Super simple installation.
  • Home/End - Jump to start/end as expected. ✅
  • Ctrl+Backspace removes left char instead of left word. ❌
  • Ctrl+Delete removes next word as it should. ✅
  • Shift+arrows - char-wise text selection ✅
  • Shift+Ctrl+arrows - word-wise text selection ✅
  • Shift+Home/End don't do anything. ❌
  • Backspace/Delete: When smth is selected they delete it. ✅
  • Copy/Paste/Cut: ❌
    • It's Alt+W/Ctrl+Y/Ctrl+W instead of Ctrl+C/Ctrl+V/Ctrl+X.
    • All work with selection as expected.
    • All work with internal buffer instead of system clipboard.
  • System clipboard:
    • Can't copy selection to clipboard, can't paste clipboard into selection.
    • Ctrl+Shift+C/V work as they do in vanilla bash: copy what is selected with mouse to clipboard, paste from clipboard.
  • Ctrl+C prints current command and starts new one like in vanilla bash.

zsh-shift-select

  • Stated to have best compatibiliy with Alacritty.
    • Alacritty requires Cargo (440MB).
      • cannot install package alacritty 0.16.1, it requires rustc 1.85.0 or newer, while the currently active rustc version is 1.75.0 Fail. Will use Gnome Terminal instead.
  • Needs zsh, super simple installation.
    • Zsh should be default shell, gnome-shell crashed with SIGSEGV.
    • Plugin itself has simple installation, just git clone .zsh file and source it in .zshrc
  • Ctrl+arrows - prints CD instead of moving word-wise ❌
  • Ctrl+Backspace, Ctrl+Delete - are not deleting left/right word ❌
  • Home/End - Jump to start/end as expected. ✅
  • Shift+Left/Right - char-wise text selection ✅
  • Shift+Ctrl+arrows - word-wise text selection ✅
  • Shift+Home/End don't do anything. ❌
  • Shift+Up/Down - Select one line up/down ✅
  • Backspace/Delete - When smth is selected - delete it. ✅
  • Copy/Paste/Cut: ❌
    • Documented as Alt+W/Ctrl+Y/Ctrl+W instead of Ctrl+C/Ctrl+V/Ctrl+X.
    • Alt+W/Ctrl+Y work as copy/paste.
    • Ctrl+W removes previous word instead of Cut selection.
    • Work with internal buffer instead of system clipboard.
  • System clipboard:
    • Ctrl+Shift+C/V work as they do in blesh and vanilla bash.
    • Can't copy selection to clipboard, can't paste clipboard into selection.
  • Ctrl+C prints current command and starts new one like in vanilla bash.

Gnome Terminal + Powershell + PSReadLine

PSReadLine starts with EditMode = Emacs by default.

Set-PSReadLineOption -EditMode Windows Fixes Ctrl+arrows, Ctrl+backspace, Shift+Ctrl+arrows.

  • Ctrl+arrows ❌✅
  • Ctrl+Backspace, Ctrl+Delete ❌
  • Home/End ✅
  • Shift+Left/Right - Bugged, starts selecting but switches to printing D;D;D;
  • Shift+Ctrl+arrows ❌✅
  • Shift+Home/End - instead of selecting, it scrolls viewport to top/bottom ❌
  • Shift+Up/Down ❌
  • Shift+Enter - should add a new line without execute, reassign doesn't help ❌

Windows + conhost + Powershell Core

PSReadLine starts with EditMode = Windows by default.

  • Ctrl+arrows ✅
  • Ctrl+Backspace, Ctrl+Delete ✅
  • Home/End ✅
  • Shift+Left/Right ✅
  • Shift+Ctrl+arrows ✅
  • Shift+Home/End ✅
  • Shift+Up/Down ❌
  • Shift+Enter ✅
  • Esc - clear current command ✅
  • Ctrl+C,Ctrl+V,Ctrl+X - Flawless, all with system clipboard. ✅
[–] stupid_asshole69@hexbear.net 2 points 1 week ago (1 children)

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

[–] podbrushkin@mander.xyz 2 points 1 week ago (1 children)

I was able to test out what you’re looking for on macos and its default out of the box

This is so cool. Unfortunately, macos isn't an option for me and never had been (for common reasons why people usually switch to linux).

[–] stupid_asshole69@hexbear.net 2 points 1 week ago

I’m glad you got it set up how you were looking to! Wezterm is a new one for me.

[–] pathos@lemmy.ml 1 points 1 week ago

Any particular recommendation?

[–] Alaknar@sopuli.xyz 0 points 1 week ago (1 children)

Please keep at it! I've been looking for a while and I'm shocked how difficult such a seemingly simple thing is to get on Linux...

[–] podbrushkin@mander.xyz 1 points 1 week ago

I've got what I wanted, but I'm a powershell user. For Bash, blesh looks very promising - it's functionally same component as PSReadLine which makes all this stuff possible in pwsh.