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.

  • TurboWafflz@lemmy.world
    link
    fedilink
    arrow-up
    12
    ·
    1 day ago

    I think if we want something like that to be consistent everywhere we need to stop using Ctrl so much as a modifier for non-terminal tasks. It doesn’t solve everything, but using Alt or Super for copy and paste like Haiku and MacOS do is a big step in the right direction. It’s just hard to change an established custom without making the whole experience less consistent

    • podbrushkin@mander.xyzOP
      link
      fedilink
      arrow-up
      8
      ·
      1 day ago

      It’s nice to see you think of it as of movement towards consistency. I also look at it this way.

      But what is it about Ctrl? Text editing is historically the main task of computers, and Ctrl is the main “modifier” key. To me it seems fair it’s dedicated for some text editing shortcuts. Probably they are consistent since 1980’s.

      • pr06lefs@lemmy.ml
        link
        fedilink
        arrow-up
        11
        arrow-down
        1
        ·
        edit-2
        1 day ago

        but ctrl-c to cancel terminal tasks predates the 1980s. the inconsistency came in when apple decided to ignore that precedent and introduce ctrl-c, ctrl-x, and ctrl-v as shortcuts in their graphical UI.

        to achieve consistency, probably better to invent a new terminal type that does away with the accumulated cruft of 50 years. problem is you would also need new cli programs to go with it.

        • Alaknár@sopuli.xyz
          link
          fedilink
          English
          arrow-up
          3
          arrow-down
          1
          ·
          20 hours ago

          Your comment reads extremely weird, considering both Mac and Windows handle this with zero issues.

          It’s super simple: if you’re in Select mode (any text is selected), Ctrl+C copies. In any other case, Ctrl-C is the cancel command.