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.

  • Alaknár@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    3
    arrow-down
    2
    ·
    2 days ago

    The thing is that vi and emacs have existed since long before those other new editors came around.

    What a weird thing to say… So what that they existed before? Who cares?

    Ctrl/Shift modifiers work in a very consistent way in the entirety of Windows, most of Mac, and… everywhere in Linux except the terminal.

    It boggles my mind that there isn’t a simple switch to toggle between “classic” and “modern” style for keybinds.

    • Ferk@lemmy.ml
      link
      fedilink
      arrow-up
      2
      arrow-down
      1
      ·
      edit-2
      14 hours ago

      Is it weird to explain the reason why something is as it is? If you were already aware of it then it shouldn’t be as baffling.

      There are also modern terminals and shells that do things the way you expect in a more convenient way, but maybe you also know this, OP mentioned powershell, that can be used in Linux too. It’s just that this hasn’t been a focus for traditional and slim/lightweight terminals coupled with traditional shells which is typically the popular combination amongst heavy terminal users, many of the slim terminal apps stay away from GUI toolkits that are what normally give consistency in settings to the GUI apps. And because they are slim and try to eliminate what isn’t absolutely needed, typically they don’t do configuration profiles, specially given that it’s relatively easy in Linux to backup and reuse your configuration across installs. It’s more of a job at the OS/sysadmin level.

      There’s also not a real standardized setup in Linux as a whole. There are environments that default using the Super (Windows) key for all window management, or use TUI terminal apps for most things so they get terminal navigation keys for all their apps. Some people even configure Gtk/Qt to use vim/emacs style for navigation in text boxes because for them it’s the other way around, all their apps use terminal shortcuts because… well… they are terminal apps.

      • Alaknár@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        14 hours ago

        Is it weird to explain the reason why something is as it is? If you were already aware of it then it shouldn’t be as baffling.

        Imagine this conversation:

        OP: Hi guys, I’m looking for yellow tomatoes, do you know where can I get them?

        You: Well, tomatoes are usually red because of [valid biological reason].

        You see how weird that is?

        There are also modern terminals and shells that do things the way you expect in a more convenient way, but maybe you also know this

        Clearly, neither me nor the OP know this. If that wasn’t the case, I would’ve provided OP with an answer to the question they posted!

        OP mentioned powershell, he just use that (pwsh) in Linux

        PowerShell still runs inside a terminal emulator (e.g. Fish), so it changes nothing in the input/output behaviour.

        personally I haven’t tried the more GUI-friendly terminals

        “GUI-friendly terminals”? What does that mean, in the context of the conversation?

        Why are you talking about GUI?

        • Ferk@lemmy.ml
          link
          fedilink
          arrow-up
          1
          ·
          edit-2
          6 hours ago

          You’re not being fair, that wasn’t the conversation thread at all… I didn’t reply to OP’s initial message directly.

          It was more like this:

          1. OP: Hi guys, I’m looking for yellow tomatoes, do you know where can I get them?

          2. Commenter: I go to this store, they have tomatoes that are yellow enough for me… for more sophistication you need to go to a much further away local shop.

          3. OP Response: My question isn’t sophisticated! …all I want is my tomatoes to be of the same color as all the other yellow vegetables I exclusively eat, all yellow, tomatoes and ketchup being red is a step in the opposite direction.

          4. Me: there’s a reason why the red ones are sold, [valid cultural reason]. But you can still change them, here’s a manual / recipe to turn them yellow when cooking.

          As you see, when I was talking about reasons it was mainly directed to the apparent indignation of comment “3”, when the person was painting their request as something that should be seen as the more reasonable / less sophisticated approach… so I gave the reason to show how the opposite is also more reasonable / less sophisticated from another point of view.

          But even then, I did link to the manual for readline to configure the input handling. It’s not like I just dismissed the initial question like your simplification implied.

          PowerShell still runs inside a terminal emulator (e.g. Fish), so it changes nothing in the input/output behaviour.

          You can definitely change the input/output behavior by changing the program that runs on the terminal… in fact, when I posted that link earlier, what I said is that you can configure this in readline, which is a library that bash and many other programs that run in the terminal (not all, not fish, for example) use for interpreting the input, so all terminal programs using the readline library for handling interactive input have the same shortcuts. It’s not the terminal the one with those shortcuts coded into it.

          “GUI-friendly terminals”? What does that mean, in the context of the conversation? Why are you talking about GUI?

          Because a terminal emulator is a GUI app… OP wasn’t talking about about real terminals, nor about a virtual console session in Linux (which runs without any GUI), but about a terminal emulator you open in a window within a graphical compositor.

          My point was that most of the popular (amongst terminal nerds) GUI app terminals stay away from the traditional GUI toolkits when possible because they want to keep the app slim and lightweight. And it’s those toolkits the ones that orchestrate the standardization of the typical Windows-like shortcuts (similar as the readline library, but for GUI apps). This is also why in many terminals you don’t even have a menu when you right click, since those menus are usually done with GUI toolkits. But there are also heavy-weight terminals like the ones bundled in some more user-friendly DEs that do include GUI toolkits as dependencies, so they might actually have an easier go at playing nice with other conventions in their respective DEs. However, you’d still need to pair it with a shell that also plays nice (or configure it to play nice, if possible).

    • non_burglar@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      2 days ago

      Ctrl/Shift modifiers work in a very consistent way in the entirety of Windows, most of Mac, and… everywhere in Linux except the terminal.

      You are either very new or you’re being intentionally obtuse, this is absolutely not true. The CMD “terminal” in Windows, for instance, don’t behave anywhere close to the rest of the system with regard to cp/paste, tab completion, etc.

      Terminals are used for more than installing packages and editing files. If I login to the old solaris boxes at work via serial console and all the key bindings are fucked, I’m not getting the job done. I and most of my contemporaries rely on the way VT 100 terminal emulators work, which is why we can’t use kitty, alacrity, etc.

      If you want that “consistency”, use one of those terminal emulators that allows these behaviours.

      • Alaknár@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        2
        ·
        2 days ago

        The CMD “terminal” in Windows, for instance, don’t behave anywhere close to the rest of the system with regard to cp/paste

        Do I need to record a screencap from conhost.exe for you to believe me when I say you’re wrong?

        tab completion, etc.

        Where did that come from? I never said anything about tab completion or “etc”. I was talking specifically about Ctrl/Shift combinations with arrows/backspace/home/end, and such.

        Terminals are used for more than installing packages and editing files. If I login to the old solaris boxes at work via serial console and all the key bindings are fucked, I’m not getting the job done. I and most of my contemporaries rely on the way VT 100 terminal emulators work, which is why we can’t use kitty, alacrity, etc.

        Did you even read what I wrote? I said that there should be an option to switch between “modern” and “classic” keybinds. With the default being set to “classic” everywhere, how exactly would that cause any problems for you?

        If you want that “consistency”, use one of those terminal emulators that allows these behaviours.

        Mate, are you high? That’s what the OP is asking for. Do you know any such terminal emulators? Post some names!