Live data from Hacker News

Everything you ever wanted to know about terminals

xn--rpa.cc

151–160 of 191 posts

Re: Everything you ever wanted to know about terminals

#151
post #148

> being compatible only with ANSI-capable terminals is a feature, not a bug, go the fuck away. terminfo is a fucking joke. nobody needs to target obscure dumb terminals (or smart terminals, for that matter) from 1983 anymore. No, terminal emulators differ all over the place, especially for new features . Do you want to lock yourself in and only use the ancient ANSI codes? In, like you say, “THE TWENTY FIRST FUCKING C…

[deleted]

Re: Everything you ever wanted to know about terminals

#153
post #23

The author seems to really not like ncurses. But why? Is there something wrong with it?

The only reason I found in the article was "because jesus f. christ" (near the end). Therefore I assume the author has religious objections against nurses. /s In fact they mention various issues with their approach that nurses would fix automatically and without the user having to configure stuff in the app: > sadly, true color isn't supported on many terminals, urxvt tragically included. for this reason, your progra…

PS: AUtocorrect seems to have changed all my 'ncurses' instances to 'nurses', doh

Re: Everything you ever wanted to know about terminals

#154
post #145
post #47

Earlier quoted context omitted.

Not all terminal emulators follow that completely. Most only include a subset and some include their own proprietary escape codes too (like iTerm and Terminology have codes for rendering images. tmux has an escape code for changing the session title). Then there's other specs not included in that doc even outside of the aforementioned proprietary codes. Like Sixel, conventions on non-POSIX terminals, etc. Also lets n…

hTerm and also IIRC kitty have image-rendering escape sequences too.

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...

Re: Everything you ever wanted to know about terminals

#155
post #83

Earlier quoted context omitted.

I don't know about authoritative but this is at least iconic if not definitive http://rtfm.etla.org/xterm/ctlseq.html

This is a great table of control sequences, but the second author cited as maintainer from 1996 to 1999, Thomas Dickey, currently maintains a list at his invisible-island.net site. https://invisible-island.net/xterm/ctlseqs/ctlseqs.html

Thomas Dickey is also the maintainer of the ncurses library.

Re: Everything you ever wanted to know about terminals

#156
post #40

A while ago I was trying to find a way to make my terminal scroll back up after a command executed, so that if the output was long I could read it from the top without having to scroll up manually. There are ways to get yours shell to print something after the command executes, so I just needed to find an ansi escape sequence that would scroll up. Unfortunately I didn't see any sequences that do this. Anyone have any…

Yeah it sounds like you need tmux and / or screen as the other anons have been saying. You can then split your terminal in its window, have a status bar which can display things, create multiple virtual terminals, view them on other terminals at the same time, etc. When I was first introduced to Unix in the mid-1990s I didn't know about screen and it would have saved me a lot of pain as I used a dial up connection. Once you start using one or the other there is no going back.

Re: Everything you ever wanted to know about terminals

#157
I'm probably interested in reading the material, but the colours and font make it difficult to do so. Of course, I could switch my browser to reader mode. It would only take a moment. And perhaps this attention-seeking author has some great insights. Maybe my life would be changed, if I just took the time to decode the message. Maybe.

Re: Everything you ever wanted to know about terminals

#158
post #47

Earlier quoted context omitted.

https://www.ecma-international.org/publications-and-standard...

Not all terminal emulators follow that completely. Most only include a subset and some include their own proprietary escape codes too (like iTerm and Terminology have codes for rendering images. tmux has an escape code for changing the session title). Then there's other specs not included in that doc even outside of the aforementioned proprietary codes. Like Sixel, conventions on non-POSIX terminals, etc. Also lets n…

No post body was provided.

Re: Everything you ever wanted to know about terminals

#159
post #116

Earlier quoted context omitted.

The relevant ECMA standards are full of crazy bullshit that, to the best of my knowledge, nobody has ever implemented in any hardware or software terminal, like control sequences to make lines of text run vertically (SPD), or to fully justify text (JFY), or to use a Fraktur font (SGR 20). They're also incomplete -- they go into very little detail explaining what various control sequences should do, especially in exce…

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 widely supported than the Fraktur escape sequence.

This isn't me being critical in what you've done though. More of an adjacent commentary about the state of ANSI escape sequences.

Re: Everything you ever wanted to know about terminals

#160
post #37

I built a cross platform app to print 'pretty formatted' source code [1]. I didn't want to re-invent the wheel on formatting source code, so looked at all the existing libraries. Originally I figured formatting to HTML, and then building a print-friendly HTML render would work. But this proved super challenging. I tried a dozen HTML engines (including Chromium) but none gave me enough control to render just a single…

> Originally I figured formatting to HTML, and then building a print-friendly HTML render would work. But this proved super challenging. [...] none gave me enough control to render just a single page of the original source file

Nothing like as powerful as your app and entirely tangential to the topic of ANSI escapes, but my preferred way to generate HTML from source code is simply:

    vim +TOhtml +wq +q path/to/source/file.ext
That will save an HTML version at `path/to/source/file.ext.html` (conforming to my .vimrc's syntax settings, theme, etc) and I'm happy enough with my browser or system's print dialog to go from there.
Post reply on HN