💾 Archived View for ew.srht.site › en › 2022 › 20220130-re-cmd-line-computing.gmi captured on 2024-03-21 at 15:22:45. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2022-03-01)
-=-=-=-=-=-=-
Cadence is on their way to explore the wondrous world of the commandline.
It turns out that I took a lot of things for granted in a graphical environment that I lost when moving to a console environment. (You might have seen this coming.)
gemini://cadence.moe/gemlog/2022-01-29-command-line-computing-difficulties.bliz
Well, you don't lose them --- these things just hide in some part of the computing universe you never knew it existed.
Copy and paste between "terminals" works, as long as you use some "GUI" environment. For people, who are not well versed on the shell, using X and a tiling window manager (like i3, xmonad, awesome ...) is indistinguishable from working without a GUI. So you can cheat a little and get mouse copy and paste back. Beware: tiling window managers are a separate beast to tame[a].
Ok, so you are really working on the console? And you want to keep it that way? Well, then there used to be gpm, general purpose mouse ... let's see whether this is still there ... yes it is. And it still works :-) So that might help you.
You are on the console, but you use a terminal multiplexer? Like screen or tmux? These beasts have a thing called "copy mode". Enter copy mode, move to the desired text, mark and copy it. Leave copy mode and paste text at point. I'm not fluent in this one, so be sure to check the documentation. Ah, I see, you have come across this. Good!
Some individual applications do support an internal clipboard (like Emacs and its "kill ring"), ...
Well, yes, you can, of course, open emacs and type "M-x shell". And you will have emacs' internal copy and paste at your finger tips. However, emacs/shell is not 100% the same thing as a shell on a console. Programms having their own idea about "the console" might not work particularly well. I just tried with top, and it wasn't bad. But it's something to keep in mind. But emacs is emacs and not the answer to all question computy. I myself live in the shell (bash) and emacs. My use of shell predates my use of emacs by a couple of years, so I never got the hang of "M-x shell".
I don't know about Ctlr-Backspace and the like, but I would like to point out, that at least in bash you can chose vi or emacs mode. Well more precisely, bash uses the readline library to deal with the user's input. All tricks built into this library are available.
Talking about keys: I refuse to establish C-x/C-c/C-v as cut/copy/paste in my muscle memory. Because C-c is killing the running command. And C-v is useful to enter a verbatim Ctrl-M (half of Windows line end) into some expression on the shell. But this point is the source of heated arguments. Just choose your way and move on.
On the console, be sure to read about "setupcon". On Debian I use this setup
$ cat /etc/default/keyboard # KEYBOARD CONFIGURATION FILE # Consult the keyboard(5) manual page. XKBMODEL="pc105" XKBLAYOUT="us" XKBVARIANT="altgr-intl" XKBOPTIONS="compose:ralt,caps:ctrl_modifier,terminate:ctrl_alt_bksp" BACKSPACE="guess"
So calling setupcon as root before I log in as non-root will enable the compose key in the console.
Be sure to check the LANG environment variable. I discovered that "C.UTF-8" does wonders, too. And be sure you have installed sufficient font files.
I got into this kind of game, because some time ago a new install on my small netbook rendered the screen black when starting X. So I made it a feature to work on the console. Add UTC timezone for increased nerd level. There's more :-) Later I found that installing the missing package firmware-amd-graphics made X11 or wayland show up on the screen.
Good luck!
~ew
---
[a] I used X11 and the fvwm2 window manager for many years. Repeat: many years. Then some day I read an intriguing article [b]. So I tried xmonad with the clear expectation, that I'm fed up with this philosophy within an hour. Not so. After a week I was still comfortable. I changed to awesome at my workplace and later to i3 everywhere. I am haskell illiterate and I did not understand, how to customize xmonad. I'm very happy with i3 and it's wayland replacement sway. I never looked back.