Live data from Hacker News

Entering text in the terminal is complicated

jvns.ca

181–190 of 229 posts

Re: Entering text in the terminal is complicated

#181
post #66

Likely an unpopular take, but I switched to the "Natural text editing" preset in iTerm2 to get editing shortcuts that match the traditional macOS ones. It has the advantage of just remapping to the normal control sequences inside terminal apps, so you basically get this functionality everywhere without needed to change it in multiple places/worry about readline support/etc. It isn't perfect (I have rarely needed to e…

Came here to say this, it's one of the first things I configure when I install iTerm.

Being able to naturally use cmd+arrows, opt+arrows, cmd+del or opt+del is invaluable to me. I don't want text editing in my terminal to be special.

Re: Entering text in the terminal is complicated

#182

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…

Thanks for the screencast. Another +1 for bringing it back to life!

Re: Entering text in the terminal is complicated

#183

> license reasons, if the program’s license is not GPL-compatible – readline is GPL-licensed, not LGPL The older I get, the less patient I become with finding out some user experience sucks because of GPL / non-GPL knife fights. It's been thirty-nine years now. I think the GPL was useful at its origin, but now the benefits of open-source are proven out, the world is deeply interconnected via the Internet, and it's a…

No, the GPL license for GNU Readline is very intentional. There is a bunch of written history from Richard Stallman about it. He felt it provided such an large advantage, that some programs might switch to GPL to use GNU Readline. After 35 years of development (started in 1989 according to Wiki), it has a hefty start is someone wants to beat it with a "clean room" BSD-licensed edition. Some HN info about Stallman's r…

Yes, I think we are in agreement. The GPL in this era is a wrench in the process of useful code. You have brought to my attention how intentional that was.

Rms did something impressive but he doesn't impress me in this day and age. Many revolutionaries make for poor governors; in my personal opinion the software ecosystem would be best served by cutting around him these days.

Re: Entering text in the terminal is complicated

#184

Earlier quoted context omitted.

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!

The ISC is basically pretty similar to the MIT license.

Re: Entering text in the terminal is complicated

#185
post #180

Earlier quoted context omitted.

"even though entering some text and editing it is a very “basic” task, it took me maybe 15 years of using the terminal every single day to get used to using Ctrl+A to go to the beginning of the line (or Ctrl+E for the end)." This sounded to me like she was describing a problem. My bad. And I too am allowed express opinions, no?

In your first comment, you said it "seems weird" that Julia doesn't like Vi-mode. In this comment, you quote Julia talking about Emacs-mode. Which doesn't really follow on from your first comment.

Thanks. I appreciate your civility.

The lack of clarity is my fault.

I felt Julia was describing a problem that she was having for 15 years to do with editing on the CLI. Then she said "even though I’m a vim user I didn’t really like using it when I tried it."

To me, even still, it seems weird that there is a tool (vi-mode) that solves the problem she seemed to be describing earlier on. I am not denying that she "didn’t really like using it when I tried it".

Not sure that even with this reply I have cleared up my earlier confusion-causing comment. I shall endeavour to refrain from further nonsense in the future.

Re: Entering text in the terminal is complicated

#186
post #96

the top three default readline keybindings that would improve people's lives if they knew about them: - control-w, which julia mentions in the post, to delete the last word - control-o: when you're recalling a line from history, edited or no, runs the line and recalls the following line from history . so you can run a sequence of five commands from history by navigating to the first one and hitting control-o five tim…

I've always wondered why control-s was chosen for this, given the obvious conflict with XOFF (pause), which in my experience is the default almost everywhere. One would have to (a) know why it wasn't working and (b) be willing to disable XOFF, in order to use that key combination for the forward history feature.

nowadays it is usually not the default anymore, since tcp connections and unix pipes have other ways to avoid overflowing their buffers. the history is that that keybinding originated on its. as i understand it, its also had another flow control protocol to avoid overflowing serial terminal buffers, the moral equivalent of the enq/ack scheme, which doesn't depend on hard real-time responsiveness to work reliably. (but it wasn't just literally ^e and ^f since emacs uses those even more than ^s.)

initially to get emacs running on unix systems you had to do a lot more than just stty -ixon -ixoff; you had to upgrade your host's ram and convince the other users that an editor was a reasonable use of such a large amount of resources. by comparison, adding a couple of extra wires to the modem cable to support rts/cts flow control (which was more reliable anyway) was no big deal

but yeah, it was a big pain for about 15 years, from 01990 to 02005. it still bites me occasionally when i accidentally type ^a^f in screen and accidentally enable xoff!

Re: Entering text in the terminal is complicated

#187
post #180

Earlier quoted context omitted.

In your first comment, you said it "seems weird" that Julia doesn't like Vi-mode. In this comment, you quote Julia talking about Emacs-mode. Which doesn't really follow on from your first comment.

Thanks. I appreciate your civility. The lack of clarity is my fault. I felt Julia was describing a problem that she was having for 15 years to do with editing on the CLI. Then she said "even though I’m a vim user I didn’t really like using it when I tried it." To me, even still, it seems weird that there is a tool (vi-mode) that solves the problem she seemed to be describing earlier on. I am not denying that she "did…

Ah, this reply does indeed make it clearer what you were saying :)

Whether I agree with what you were saying is a different matter (:p) but at least it makes more sense now!

Re: Entering text in the terminal is complicated

#188
post #162
post #89

Earlier quoted context omitted.

> The trouble is programs running in terminal may want to deal with Ctrl-C by themselves. Text editors for example do that, but terminals have no way to know it. Terminals even don't know what program is running now, because job control is a job of a shell. But then why does Windows Terminal (even when running against WSL) not have this problem? The terminal doesn’t need to know what’s running inside it to know “if t…

Idk, but I can guess. In windows terminal and shell are not so separate as in Unix. For example, is cmd.exe is a terminal or a shell? I believe it is both. Probably it is the same with powershell.

This is a mistake, but forgivable, as Windows executable launch behavior blurs this distinction.

Just like UNIX shells, cmd and PowerShell are ordinary console programs.

The Windows equivalent to xterm and friends — i.e., the mechanism responsible for displaying console I/O in a window — is a bit complicated, has changed over time, and only recently (Windows 10 1809 / Server 2019) adopted a UNIX-like pseudo tty / terminal emulator model.

For a good overview of Windows console architecture, past and present, see

https://devblogs.microsoft.com/commandline/windows-command-l...

Re: Entering text in the terminal is complicated

#189

Earlier quoted context omitted.

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…

Trust me, I understand that Linux is all about reading. I also understand that it is perpetually irrelevant in the consumer computer space, despite everyone in that space absolutely hating the dominate OS. A hate that you can watch grow in virtually real time on any social platform. But that hate is focused on pushing the giant back in-line, not at abandoning that giant for fresh pastures. You know why? Because 30 ye…

Most consumers want appliances, aka a collection of software pre configured with a few customization options. When the current solutions (ipad, phone, MacBook, PC) fit, it’s great. And the current linux desktop distros are doing great in that regard, except on two points. They do not come pre-installed (with hardware support) and some software don’t support linux.

But as soon as you want something custom and do your own configuration, the manuals are required. Or you get someone to do it for you.

Re: Entering text in the terminal is complicated

#190

Earlier quoted context omitted.

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…

Trust me, I understand that Linux is all about reading. I also understand that it is perpetually irrelevant in the consumer computer space, despite everyone in that space absolutely hating the dominate OS. A hate that you can watch grow in virtually real time on any social platform. But that hate is focused on pushing the giant back in-line, not at abandoning that giant for fresh pastures. You know why? Because 30 ye…

Truth, but!

The middle hellish experience being described here is not a bad thing.

Fact is, Ubuntu used as autopilot is pretty great! It is way better than it used to be. Mere mortals can jump on a computer and often get the few things they want done.

What I do with users of that type, and myself depending on my moods and motivations for a particular machine, is treat it like Android.

Find the users an app they can click on and or tell them it is not going to happen.

Many will be happy with that.

The ones who are not need help.

Either they grow and become readers, and can pilot the computer properly, or they won't and helping them makes as much sense as their own efforts do.

Post reply on HN