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.

  • stupid_asshole69 [none/use name]@hexbear.net
    link
    fedilink
    English
    arrow-up
    4
    ·
    1 day ago

    I am not trying to insult you, I am trying to help you to not do something stupid.

    I understand that you think everything working the same would be better, I was trying to explain how that’s not the case and you will ultimately be better off not doing the thing you’re suggesting.

    To butcher a car metaphor: a peterbilt has lots more controls and gauges than a camry and they’re in different places some of the time. Wouldn’t it be better to make all the controls the same? No, of course not. A low range gearbox, intercooler temperature gauge, gigantic steering wheel with a knob and all the other differences are necessary for effectively hauling freight. Those same controls are not useful in a sedan. Do truckers have massive problems driving the grocery getter when they’re not working? No, of course they don’t. Sometimes you might give the gear selector a pull in the wrong direction but that’s no big deal.

    Instead of making a mutant terminal and dealing with all the problems that could cause you, you will almost always find it’s better to learn screen or tmux (with one of their default bindings) because then you will have a fewer problems, an easy time communicating with people about the ones you do have, and a broader skillset.

    Again, I am not trying to insult you, I am trying to keep you from doing something stupid.

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

      I feel like you’re just defending the final state you observe. E.g. why do you hate shift+arrows for text selection but not arrows themselves for moving a cursor? And how selecting text with a mouse is better? I find it even funny to think one of these techniques is cursed and other are blessed. Never I could imagine selecting text with Shift can encounter such opposition.

      • stupid_asshole69 [none/use name]@hexbear.net
        link
        fedilink
        English
        arrow-up
        2
        ·
        1 day ago

        I do not hate selecting text with shift. I do not even oppose selecting text with shift. The Macintosh user interface model is the standard for gui operations. It’s good to know how to use the interface of gui applications because usually the majority of your time will be spent in them.

        The terminal has a different interface. It’s different for a lot of reasons. Some are historical, some are technical, some are based on interface standards and ideas.

        I’m trying to help you understand how learning to use the terminal as it exists will be a better solution than making the terminal behave in the way you’re already familiar with.

        The reason it’s a better solution is that using the terminal as it exists allows you to more easily communicate and learn & allows you to use a broad range of tools on any system without having to import a bunch of configurations, programs or environment variables.

        It’s easy to read my comments and come to the conclusion that wanting to use the Macintosh text selection keys is the thing I think is stupid, but what I’m trying to reiterate in every reply is that making the terminal use Macintosh text selection keys is the thing I think is stupid.

        Part of learning how to use a computer is developing a combination of skills and tools that you can use to solve the problems that communicating by doing mathematics really fast always entails. I am trying to convince you to learn the toolbox the computers terminal comes with before you start to weld a tire iron on to your ratchet wrench.

        • podbrushkin@mander.xyzOP
          link
          fedilink
          arrow-up
          1
          ·
          22 hours ago

          Macintosh has nothing to do with it. Maybe I want to grow selection to the left with E and to the right with R - they are not Macintosh keys, but still I will have a hard time trying to get what I want.

          Do you mean this whole concept of growing selection from the same cursor you type with and performing operations on this selected area as a single entity is a Macintosh-way, originated in GUI? And its foreign to terminals and terminals developed a different way of editing text and you propose learning this native text-editing without using foreign techniques like cursor-based text selection… This makes sense. And sure it’s possible to be effective in terminal while using it traditional way. If this is what you mean, now I understand.

          I made a glimpse on the world where this shift-selection doesn’t exist and got excited about this feature even more, and I even think it’s genius.

          System-wide clipboard is probably not the “traditional way” either, and it doesn’t work quite well in Linux terminals too.

          A couple of years ago I invested some time into Vim and it was a pleasant experience, but it was detached from all other experiences I had on my PC. Mentally switching between different text editing modes is disgusting, I hate it so much. I don’t want a new one. I’m fine with the one I have.

          Linux and its terminals are meaningful only as long as they do what I want them to do. I don’t care if some of my activities are “not Linux-way”.

          • stupid_asshole69 [none/use name]@hexbear.net
            link
            fedilink
            English
            arrow-up
            2
            ·
            21 hours ago

            Yeah when I call them the Macintosh keys that’s because I’m almost 100% that the 84 Macintosh was the first thing to use them. Not just the keys specifically, but that operating model we I guess later called wysiwyg. I think it was command instead of control, but it occupies the same place on the keyboard. It’s certainly the oldest thing I’ve used that had them. Windows used to do it like old dos word processors did, with insert and delete etc.

            It’s the design and interface language of gui software for at least 40 years and everyone should know it.

            System wide clipboard would work fine in the terminal but it would be a downgrade, you’d have to give up all the lovely buffers that all your different editors use and are designed around. Even lowly less has a buffer select somewhere in there. Most of the time shift-ctrl-v lets me dump the whatever the system clipboard is out into the command prompt if I need to.

            If the idea of using a different modality for editing text bugs you so much, what do you think of the fact that you already use one? When you’re typing your fingers are on the home row and when you need to edit you switch your right hand to the arrow and function keys. It’s a lot like how editing in vim requires me to move my right hand one key over to the left.

            That way of thinking is how I was able to accept learning vi keys and vim about twenty years ago when I had the same thoughts as you about new shortcuts.

            An alternative might be using macos. I can’t remember if it uses the mac keys to cut and paste into its terminals but it might.