Live data from Hacker News

Everything you ever wanted to know about terminals

xn--rpa.cc

181–190 of 191 posts

Re: Everything you ever wanted to know about terminals

#181
post #144

For anyone else on iOS Safari: turn the font size up to 300% on the left hand side of the URL bar. I’m not even geriatric.

This site would actually has a decent font size and a responsive layout (within reason, code snippes will have additional line breaks) but your browser (like all mobile browser) is intentionally pretending to have a larger desktop viewport and scaling down the result. The way for the website to disable this unhelpful behavior is include the following tag in their :

  
It is unfortunate that mobile browser developers have decided to break usability of perfectly fine websites just to provide a workaround for the rare site that has a rigid table-based layout. It is sad that this workaround is still the default now that mobile browsers have a dedicated desktop mode that can be used for such sites.

Re: Everything you ever wanted to know about terminals

#182
post #131

My understanding is that control codes for [every possible modifier key combination] + ['standard' US keyboard keys] aren't all standardized. Is that correct? I seem to recall having a hell of a time trying to figure out which key combinations Emacs could understand and why (keyboard -> OS -> terminal emulator -> protocol -> program.) Are there any proposals? Workarounds? Proofs-of-concept?

They pretty much are. Terminals implement CTRL keyboard shortcuts as `c ^ 0100` and ALT works by prefixing '\e'. Stuff like arrow keys encode using VT100 codes. Those are three very simple rule that everyone knows. $ wget https://justine.lol/ttyinfo.com $ chmod +x ttyinfo.com $ ./ttyinfo.com "\001" is CTRL-A a.k.a. ^A "\000" is CTRL-@ a.k.a. ^@ "\002" is CTRL-B a.k.a. ^B "\f" is CTRL-L a.k.a. ^L "\r" is CTRL-M a.k.a.…

When I found this is a valid binary both in Windows and Unix (I've tested on my Linux and BSD VMs) I found it pretty funny, but I did not expect this to being able to grab the mouse movement in Windows at all. Pretty cool!

Re: Everything you ever wanted to know about terminals

#183
post #163

Earlier quoted context omitted.

Not familiar with hTerm. Got a link to the project? Would be good to add support for that to my image rendering library: https://github.com/lmorg/murex/blob/c77b893a58a682735ad7502c...

Upstream: https://chromium.googlesource.com/apps/libapps/+/HEAD/hterm Fork used by iSH: https://github.com/ish-app/libapps/tree/master/hterm I looked at the docs ( https://github.com/ish-app/libapps/blob/master/hterm/doc/Con... ) and it appears to use the same protocol as iTerm. Here's an implementation: https://github.com/ish-app/libapps/blob/master/hterm/etc/hte...

Thank you

Re: Everything you ever wanted to know about terminals

#184
post #182
post #131

Earlier quoted context omitted.

They pretty much are. Terminals implement CTRL keyboard shortcuts as `c ^ 0100` and ALT works by prefixing '\e'. Stuff like arrow keys encode using VT100 codes. Those are three very simple rule that everyone knows. $ wget https://justine.lol/ttyinfo.com $ chmod +x ttyinfo.com $ ./ttyinfo.com "\001" is CTRL-A a.k.a. ^A "\000" is CTRL-@ a.k.a. ^@ "\002" is CTRL-B a.k.a. ^B "\f" is CTRL-L a.k.a. ^L "\r" is CTRL-M a.k.a.…

When I found this is a valid binary both in Windows and Unix (I've tested on my Linux and BSD VMs) I found it pretty funny, but I did not expect this to being able to grab the mouse movement in Windows at all. Pretty cool!

Glad you enjoyed it! If you want to read more about the technique, please see https://justine.lol/ape.html You can also support the project through Github Sponsors.

Re: Everything you ever wanted to know about terminals

#185

The author seems not to be aware of the recent TUI rennaisance[1]. There are libraries like termbox and blessings (python) that are a middle-ground between full ncurses and adding your own ansi codes. There are a lot of modern TUI frameworks like tui-go or tui-rs that bring common GUI conventions back to the TUI (heck there are TUI programming libraries that are designed to be similar to react) - these too tend to be…

While we're piling on the TUI renaissance, check out Terminal.Gui, a cross-platform library that makes building great terminal UI's easy:

https://github.com/migueldeicaza/gui.cs

(Disclaimer, I maintain Terminal.gui).

Re: Everything you ever wanted to know about terminals

#186
post #116

Earlier quoted context omitted.

Hi I'm one of the people cited by the article. Fraktur is awesome. I implemented it in my terminal. https://github.com/jart/cosmopolitan/blob/c6bbca55e9f977e386... Now that unicode makes it easy, there's no excuse not to have fraktur!

Good to see you've added support for that but the cynic in me can't help wondering if that ANSI code is even needed. While you're right that unicode makes it easy to support, it's also even easier to output the Fraktur characters directly from the CLI application and do away with that particular escape code entirely. The bonus in doing that is you then support more terminals in the process since unicode is more widel…

Yes I understand. That's why the support is for the lulz. It's difficult to communicate tone over text.

Re: Everything you ever wanted to know about terminals

#187
post #116

Earlier quoted context omitted.

Hi I'm one of the people cited by the article. Fraktur is awesome. I implemented it in my terminal. https://github.com/jart/cosmopolitan/blob/c6bbca55e9f977e386... Now that unicode makes it easy, there's no excuse not to have fraktur!

Wow, okay, guess I can cross that one off my list of "ECMA-48 features nobody implements". There's still plenty left on that list, though -- including at least one escape sequence I'm fairly certain was included as a joke (SPQR).

[deleted]

Re: Everything you ever wanted to know about terminals

#188
post #120

Earlier quoted context omitted.

> Uh, no. Anyone on BBSes in the 90s is very aware of ANSI, thank you. And we've not died off yet. You guys should be more vocal. When you have great knowledge like that, you can't just keep it to yourself as a fond memory. People wouldn't be saying what the OP said if more of the oldskool crowd was out there blogging and mentoring the younger generation.

It's not just a fond memory. I use it in my open source. Other people use it. It's not obscure. One thing I actually agree with the author about is that these escape codes are the only relevant thing. Outside of retro computing nobody should care about supporting anything else. Other programs doing this are not exactly in short supply. Anyone can do "ls --color /bin/ls | hexdump -C" and see the secret sauce. I blog a…

This blogger put so much effort into sharing a well-written blog post explaining how we can get a better richer experience from our terminals. That's not arrogance and your comment comes across as very condescending which is worse than arrogance. I always try to be encouraging when people feel passionate about tech since I think it leads to a better culture than saying, "oh, you think this stuff is new? it's been documented a thousand times before, don't bother".

Re: Everything you ever wanted to know about terminals

#189
post #188

Earlier quoted context omitted.

It's not just a fond memory. I use it in my open source. Other people use it. It's not obscure. One thing I actually agree with the author about is that these escape codes are the only relevant thing. Outside of retro computing nobody should care about supporting anything else. Other programs doing this are not exactly in short supply. Anyone can do "ls --color /bin/ls | hexdump -C" and see the secret sauce. I blog a…

This blogger put so much effort into sharing a well-written blog post explaining how we can get a better richer experience from our terminals. That's not arrogance and your comment comes across as very condescending which is worse than arrogance. I always try to be encouraging when people feel passionate about tech since I think it leads to a better culture than saying, "oh, you think this stuff is new? it's been doc…

> This blogger put so much effort into sharing a well-written blog post explaining how we can get a better richer experience from our terminals.

I don't even believe that you believe that this is an accurate description of the post.

> That's not arrogance

Straw man argument. I was not commenting on those things, and you know it.

> and your comment comes across as very condescending which is worse than arrogance.

Clearly the original article is both condescending and arrogant. And elitist.

> "oh, you think this stuff is new? it's been documented a thousand times before, don't bother".

I didn't say that. There's value in writing it again. I don't pretend that my blog post are pushing the envelope of knowledge either, but maybe I'll explain it in a way that fits better with how some reader will better absorb it.

Anyway: I am familiar with you from the past, and how even your friends have described you as someone who likes to live life at the edge of trolling. I sense that this is what's happening now, so I will not engage further.

I wish you good day.

Re: Everything you ever wanted to know about terminals

#190
post #111

One thing that the author doesn't seem to know about is /dev/tty. In the article the escape codes are just sent to stdout. Though an awful lot of applications (including the greatest ones) do this, IMHO this is wrong. The terminal control codes are used to control a terminal, and they are often not meant to be part of the output stream, for example when the output is piped or redirected to a text file. When what you…

So what happens when you do "./foo | less"? You want "foo" to start injecting formatting to the terminal, while "less" is too?
Post reply on HN