Earlier quoted context omitted.
> Generally if you are barfing meg's of data to screen you're prolly doing something wrong... (You prolly wanna be using less?) Why? Many commands I've run have produced a lot of log output in my day.
Bc you wanna see the output? With less you can go page by page and read the output. If there is so much output you can't read it.. then what's the point of printing it to the screen? If you're looking for something in the stream then maybe you should grep for it? I'm not saying you never ever should barf to screen - but as far as I can see, you kinda have to strain yourself to concoct a "valid" usecase
WezTerm – A GPU-accelerated cross-platform terminal emulator and multiplexer
121–128 of 128 posts
Re: WezTerm – A GPU-accelerated cross-platform terminal emulator and multiplexer
#122Earlier quoted context omitted.
Lots and yes. The effort has already been made, there are lots of very capable and stable GPU accelerated terminal emulators available. The speed boost makes them worth using. If you've ever accidentally returned a minified file from grep you'll know most terminal emulators grind to a halt.
> If you've ever accidentally returned a minified file from grep you'll know most terminal emulators grind to a halt. This doesn't sound like a rendering issue, though. Many text editors can't cope with extremely long lines either, terminal-based or not. That happens when they store lines as flat buffers without any algorithmic optimization. GPU has the potential to speed up terminal rendering a little bit, but in th…
The first fix is that if you want a maximally responsive terminal you'll want to decouple input process, output processing and rendering into separate threads - this was established already in the 1980's with the Amiga console handling. E.g. any modern terminal that struggles with handles Ctrl+C is an example of why you want this.
The second fix is to "render" into a text buffer and have the renderer look at how many lines it has to scroll and rerender each time it starts a rendering pass, blit whatever is still intact, and then render what is left, rather than process character by character. When the producer overwhelms the terminal in that scenario you end up scrolling multiple lines at once. This will be jerky if the rendering is very slow but it'd need to be very slow for it to be noticeable, and even then it's generally much preferable to the terminal lagging behind.
And when you then have a process barfing gigabytes of data to the terminal, most text will not be visible more than a frame on a terminal that insists on showing it all, and won't be visible at all on one that updates faster than the frame rate anyway, and the fix above will simply entirely skip rendering most of the text. As long as your terminal can render a page full of text at a high enough frame rate it will be seamless.
With respect to the actual rendering, glyph size tends to be small enough that there's not that much to be gained in terms of acceleration other than a rectangular copy to accelerate scrolling, which is mostly relevant when the terminal doesn't handle huge chunks of data being barfed. The main exception being if you use shaders. E.g. on my personal copy of kitty I experimented with a shader to add a "glow" to characters to make it more legible on semi-transparent windows. But I've applied similar hacks to purely CPU-rendered terminals (created "poor mans outlines" by simply rendering the text multiple times at slight offsets with different colours) and good CPU-rendered terminals can do even that more than fast enough.
Re: WezTerm – A GPU-accelerated cross-platform terminal emulator and multiplexer
#123Whenever I see a terminal emulator, my first question is whether it can do the VT-100 torture test.
I'm writing my own editor. A little toy terminal I have sitting around can run it with just support for a handful of escape codes. To see how broken the terminal still was I fired up emacs. It took next to nothing to make emacs work fine (while having TERM set to vt100). I've seen very little software try to use more than a very tiny subset of vt100.
Re: WezTerm – A GPU-accelerated cross-platform terminal emulator and multiplexer
#124Earlier quoted context omitted.
Is it more complicated than wanting to update the display as often as its fresh frequency? Faster screen updates, lower CPU & power usage. You might not notice the difference until you accidentally unleash a lot of output at once - then you'll see the difference. Some terminals start to update infrequently to save themselves, some hang completely while burning the CPU. Psychologically I feel more in control of my com…
I believe that there is a difference. I would just love to understand it better. Does anyone have a benchmark of the differences? Is it like a 2-3x improvement or only much smaller? What is the actual latency? Does anyone have any links to a low level explanation?
Re: WezTerm – A GPU-accelerated cross-platform terminal emulator and multiplexer
#125Whenever I see a terminal emulator, my first question is whether it can do the VT-100 torture test.
As much as I like the idea, I feel it's not very relevant to most peoples use. I'm writing my own editor. A little toy terminal I have sitting around can run it with just support for a handful of escape codes. To see how broken the terminal still was I fired up emacs. It took next to nothing to make emacs work fine (while having TERM set to vt100). I've seen very little software try to use more than a very tiny subse…
One thing I really love in command-line interfaces is to use the double-wide, double-height characters VT-100 offers.
Even xterm supports that.
Another thing I'd love to have is smooth scrolling. Physical terminals could do that and, when a fast connection was 2400, it even made sense. In newish terminals, I'd love to have that, with progressive fallbacks to faster scrolling as the terminal backlog fills up. If your ls -l is a few lines short, it just feels nicer.
Re: WezTerm – A GPU-accelerated cross-platform terminal emulator and multiplexer
#126Earlier quoted context omitted.
As much as I like the idea, I feel it's not very relevant to most peoples use. I'm writing my own editor. A little toy terminal I have sitting around can run it with just support for a handful of escape codes. To see how broken the terminal still was I fired up emacs. It took next to nothing to make emacs work fine (while having TERM set to vt100). I've seen very little software try to use more than a very tiny subse…
> I've seen very little software try to use more than a very tiny subset of vt100. One thing I really love in command-line interfaces is to use the double-wide, double-height characters VT-100 offers. Even xterm supports that. Another thing I'd love to have is smooth scrolling. Physical terminals could do that and, when a fast connection was 2400, it even made sense. In newish terminals, I'd love to have that, with p…
Smooth-scrolling I think is generally ignored because as you can see from this thread people are obsessed with throughput over all else, and assumes the raw rendering is the bottleneck, but in my experience with terminals it rarely is - few terminals are in any way optimised for speed.
Elsewhere in this thread I've advocated for a pretty old-school solution to the throughput and responsiveness issue: Decouple IO and rendering into separate threads. The Amiga did that in 1985, and I have no reason to think it was a particular revelation back then - just necessary to produce something that'd become unresponsive too easily. That split then makes it easy to have the renderer batch updates when there is much waiting. E.g. if so much text comes that it'd scroll two lines in a frame there's no reason to scroll one line twice.
If more terminals first did that, then the converse of doing what you propose with defaulting to smooth scrolling when there is little in the buffer, and falling back on faster scrolling would also be "trivial": Just peek at the buffer of how many lines of output are waiting, and adjust scroll speed accordingly. The only difficulty, I suspect, would be to find the optimal rate of change to prevent it from looking jerky.
Re: WezTerm – A GPU-accelerated cross-platform terminal emulator and multiplexer
#127Earlier quoted context omitted.
> And of course your next keystroke is not zero copy. It needs to be sent to the GPU and the texture needs to be updated. No textures need to be updated. The texture stays in VRAM across each frame, just need to change which texture the character cell points to. That is zero-copy. If you were to do this with a software rendered terminal, at minimum the software would tell the windowing system which region of the wind…
Show me the numbers.. https://danluu.com/term-latency/
I’ve given you a rationale for why the GPU rendering technique inherently minimizes latency over the software rendered technique. Can you provide a rationale for why software rendered terminals would have an inherent advantage in terms of latency?