Swordfish90 / cool-retro-term

A good looking terminal emulator which mimics the old cathode display...
22.4k stars 854 forks source link

Add slow line move #153

Open AlanJAS opened 10 years ago

AlanJAS commented 10 years ago

One thing that I remeber on a old terminal was the speed. Now, running the cool terminal, when I run one command seems so fast! Maybe would be good add an option to simulate the old hardware.. a "line lag" time used for display each line of a command.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/5201915-add-slow-line-move?utm_campaign=plugin&utm_content=tracker%2F479407&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F479407&utm_medium=issues&utm_source=github).
Swordfish90 commented 10 years ago

That is something that I would really love. The issue here is that the code is based on a modern terminal emulator in which this function is absolutely unnecessary. We would have basically to completely rethink the way we are drawing the screen, and that's something that will require much work.

ghost commented 10 years ago

I think we can do it easily at the shell side, when slow mode enabled, every commands will pipe to a delay program.

eg:

#include <stdio.h>
#include <unistd.h>

int
main()
{
    setbuf(stdout, NULL);

    for (char c = 0; c != EOF; c = getchar()) {
        usleep(10000);
        putchar(c);
    }

    return 0;
}
stain commented 10 years ago
bash -i | ./slowmode

on @iyzsong's code works great! I change 10000 to 3000 to mimick 300 baud (e.g. 30 10-byte chars pr second), but this could be parameterized. Try starting vi or top!

btw - to compile:

gcc slowmode.cpp -o slowmode

Perhaps this should be added to the build and then used as a kind of login shell.

Arcitec commented 2 years ago

@Swordfish90 I linked two related issues (see above) which you can close as duplicates of this one.

I would totally love this feature by the way. The slow scrolling of simulated BAUD settings makes the retro feeling even more amazing, especially if you play old text adventures or telnet into BBSes.

Here's some videos showing Cathode, which implements baud simulation:

The slow rendering gives a really calm, cool effect.

Wondering if the state of the project has changed in a way that would make this feature possible? I guess you're running some terminal emulation library under the hood which just feeds you with a total buffer of all text to render on screen at the current time. And you then just generate a bitmap of those characters and display it all at once? That's my guess anyway.

But perhaps the rendering routine in cool-retro-term could be modified to add an artificial delay which prints 1 character, waits, prints 1 character, waits, prints 1 character, waits, etc. So instead of generating 1 instant bitmap of all text on screen, you would instead generate multiple textures for several in-between steps, and fade between them over time. Generating so many textures would probably hurt performance, but perhaps in-place updates can be done to replace a single "screen" texture all the time. Or just blitting back and forth between two textures (active and next texture).

Although I don't know how that would interact with things like rapidly scrolling data (i.e. a huge tree output). The underlying terminal emulator would feed it all to you very rapidly, but perhaps it doesn't update/feed you the next page of data until you're ready and query it for more text. In that case, it should still be possible to implement delayed rendering using this technique. So when the current page has been "delay-rendered", request the next page of updates from the terminal library.

Of course, the best solution would be if the terminal library itself has an "ingest speed" setting that can slow down its gobbling of STDOUT data. Maybe such a setting exists now, all these years later?

rricharz commented 8 months ago

Cool–retro-term can easily be baud rate limited in Linux using the following little program: baudrate