Live data from Hacker News

Entering text in the terminal is complicated

jvns.ca

131–140 of 229 posts

Re: Entering text in the terminal is complicated

#131
post #57

Wirth showed us decades ago how to do UIs using text in a modern way yet we remain firmly tied to digital analogues of teletype terminals. https://en.wikipedia.org/wiki/Oberon_(operating_system)

From which, plan9/sam/acme got it's inspiration afaik.

The downside is being required to use the mouse often plus some dexterity.

Re: Entering text in the terminal is complicated

#132
post #59

Earlier quoted context omitted.

@shadowgovt Genuine question: if i wanted to create new software nowadays, and i wished for it to be as you noted "mmaximally unencumbered from interoperation", which license should i choose for my software? Which license would you use? Again, not trying to be snarky; just wanting to learn and understand. :-)

I generally use the ISC license these days. It is short, indemnifies me from damage caused by the software I write being used by other people, has a thin requirement that the copyright be carried forward into other projects using my code (A requirement that I'm probably not going to enforce), And that's it. No encumbrances against interoperation with other people's code.

Today I learned! I hadn't heard of the ISC license. I've heard of GPL, Apache, MIT, and other common ones, but not USC until now. Thanks!

Re: Entering text in the terminal is complicated

#133
post #77

Earlier quoted context omitted.

Essentially nothing in Windows requires cmd.exe. Having a terminal in a desktop OS isn't a problem. Needing one is. Just like having a GUI isn't a problem for a server OS, but needing one is a problem.

Apple would disagree with you on both counts. Plus for a long time desktop Windows needed cmd.exe to support login scripts. Just as people use Linux daily without ever touching the command line. Eg Android, LG smart TVs (webOS), Satellite TV set top boxes (eg Sky Q), home routers, etc. And if you want to focus on Linux running on laptops, then there are ChromeBooks and the old Asus EeePCs. The reason desktop Linux is…

I agree about Linux + KDE being more polished.

For my main point, I suppose I should have specified GNU/Systemd/Linux as needing a CLI, not everything with a Linux kernel. POSIX-style kernel + libc is a very good basis for an OS, and such an OS doesn't need a CLI exposed to the user. It's all the Udev/Systemd/SysVInit & similar stuff that's CLI-only, and desktop Linux tends to require interacting with one or more of those on at least an occasional basis.

Re: Entering text in the terminal is complicated

#134
post #113

Earlier quoted context omitted.

it's more likely because she's running a version of dash compiled without readline support, probably debian's version (which is compiled that way because it's not intended as an interactive shell, but rather the lightest-weight posix-compliant shell they could build) i agree about ansi sequences. even that doesn't go far enough, though: we should probably be moving past character-cell terminals to something better so…

Looks like I'm wrong. If I fire up an interactive dash on Ubuntu or Debian, no arrow keys. /bin/sh is dash, but that's only for hash bang scripts. Not just no arrow keys, but nothing. No Ctrl-P to recall previous line. No editing beyond the POSIX TTY line discipline stuff: Ctrl-W word erase, Ctrl-U line erase, backspace.

also i'm wrong; it doesn't have an option to compile with readline, just libedit (which indeed is not included in the debian package configuration). the incantation was as follows:

    : Downloads; apt-get source dash
    : Downloads; cd dash-0.5.12/
    : dash-0.5.12; sudo apt install libedit-dev
    : dash-0.5.12; ./configure --with-libedit
    : dash-0.5.12; make
    : dash-0.5.12; src/dash -E
libedit supports ^r but not ^o

on the other hand my dash process with libedit is 1.3 megs rss while my bash process is 7 megs rss. and the dash executable is only 130k. still, bash is only about 20% slower to start up

Re: Entering text in the terminal is complicated

#135

Earlier quoted context omitted.

If the only Linux distributions were in the style of LFS, Gentoo and Arch* you would have a point, but as long as Ubuntu, Mint, OpenSUSE, Fedora, Manjaro and the myriad other user-friendly exist I fail to see the argument. Yes, Ubuntu has a Concorde cockpit behind the scenes and yes, I can access it on my Ubuntu work* laptop and I am grateful that I have that choice. I would hate not having that level of control. Mea…

I have used ubuntu for 2 years now, and its the motivation for the post. Ubuntu (or really any distro I am aware of) is great for pensioners (email readers) and power users (career linux user), with a protracted and hellishly complicated experience in between (technologically adept, but lifelong windows user). True, if you just want to fly straight to one of the most popular cities, you can just enter it in the autop…

A better way is to get a book about linux administration (if you want an in-depth manual) or "How Linux Works" by Brian Ward. Then learn bash.

Windows is pretty much all GUI (I've left before getting used to Powershell) and that works great until you want to do rules-based changes or do profiles (without using MDM) with changes snapshot.

Most software have good manuals so once you've got a bit used to the linux's way, it's quite easy to adjust anything you need. And after a while, you find you're mostly using a few handful packages and you'd have their configuration saved in your dotfiles. As for packages suggestions, that's what distros are there for.

Linux is all about reading.

Re: Entering text in the terminal is complicated

#136

Over 20 years ago now I wrote a state machine around readline that meant you could use it as a multi-line editor. Not "multi-line" as in a single line can wrap, but a true editor that lets you move up and down, but is windowless. Here's a video: https://github.com/colmmacc/jot/raw/master/jot-demo.mp4 and the CVS repository for the Unix terminal IM client it is part of is at: https://c-hey.redbrick.dcu.ie/src/c-hey_cv…

Yeah. That's how rio's text windows [0] look like in hold mode, except that it has a much simpler design and better support of mouse.

[0] https://p9f.org/magic/man2html/1/rio

Re: Entering text in the terminal is complicated

#138
post #88

Earlier quoted context omitted.

> free distros taken note of this? Gnome tries hard to emulate Apple's approach. Results are mixed, but I've seen fans of it. Elementary OS goes in the "normal users" direction, too. OTOH if something goes badly wrong, and you do need to open the hood and follow an arcane tech support recipe, you open a command line, be it Linux. macOS, or Windows. (Not Android or iOS though, where you do a reset + restore dance.) >…

> you open a command line Except Classic Mac OS never had this. You'd sometimes need to do arcane rituals like "re-bless the system folder", but they were entirely GUI-based arcane rituals that involved double-clicking icons, opening and closing windows, and dragging files in and out of folders.

> Except Classic Mac OS never had this.

Text interfaces: streams of discrete objects (characters) with some having special purposes

GUI: A matrix of pixels + a set of of rectangles with special properties attached.

If you want to quickly write a program, text is the way to go. Most developers are scratching their own itch and already know the system. They may surface a few GUI settings (if it's GUI), but no one wants to build a complete GUI ecosystem on top of Linux (unless you go fo a restricted version like ChromeOS or Android).

And with scripts, you can quickly write your own software by using existing ones. It can be your very special computing world.

Re: Entering text in the terminal is complicated

#139
post #7

In bash, if you set $EDITOR to your favorite text editor, you can send the current line to $EDITOR with ctrl-x ctrl-e. After editing the command you can save and exit for the command to execute.

fc builtin does the same thing. No ctrl-key sequences required.

Just type "fc"

With previous commands, one can also specify a particular editor instead of default $EDITOR

For example, to edit the previous command with ed when EDITOR=vi

  fc -e ed
A quick way to make shell scripts from command line history in vi mode (where 15th entry in history is the desired command line):

  fc 15
  w1.sh
  %d
  wq

Re: Entering text in the terminal is complicated

#140
post #95

Earlier quoted context omitted.

if you have a problem with gnu/linux (as opposed to android) you can usually find the solution on stack overflow, server fault, or superuser, but the solution you find there is going to be a textual command line, not a gui. gpt-4 can tell you how to solve the problem, but only using a textual command line, not a gui. text is the most powerful, useful, effective communication technology ever, period. always bet on tex…

But that is passionately what I hate about it. In GUI environments there are check boxes, buttons, menus and english labels for everything. With linux it's like you are copying down a sacred language and presenting it at the alter with your fingers crossed. You just changed something. Didn't fix the problem. But the change still happened. Can you undo it? Probably not without way more digging. So now you just cross a…

The usual solution is to read the manual. The CLI is not an esoteric language. Software does complex things and you can either go with the GUI-fiction which...does things. Or have every options available to do what the software can do. Take find where the first line is the manual is: find - search for files in a directory hierarchy. Think however you want to find files inside a specific directory and find can do it for you and more. Most users will only have a few use cases for finding and that's what most GUI file explorers offer, but when you need that extra power, it's available to you.

The solution for your problem is to not do stuff you don't understand. And for the above use case, there's usually a GUI for it. The CLI stuff heavily assume that you know what you're doing.

Post reply on HN