[HN Gopher] TTE: Terminal Text Effects
       ___________________________________________________________________
        
       TTE: Terminal Text Effects
        
       Author : makapuf
       Score  : 688 points
       Date   : 2024-05-28 17:31 UTC (5 hours ago)
        
 (HTM) web link (chrisbuilds.github.io)
 (TXT) w3m dump (chrisbuilds.github.io)
        
       | tambourine_man wrote:
       | This is awesome. Thanks
        
       | devdao wrote:
       | Love it, thanks for posting!
        
       | jimbobthrowawy wrote:
       | Incredibly goofy, I like it. Especially the demo gifs on the
       | page. Wonder how long until I see it be the default output for a
       | CLI I'm using. Got surprised to see someone using lolcat in the
       | wild before.
        
       | PhilipRoman wrote:
       | Great work, this will make a lovely splash screen for my tty-only
       | machine.
        
       | mickeyp wrote:
       | In a similar vein in Emacs: M-x zone
       | 
       | Every time you run it, it triggers a random screen saver effect.
       | Fun when it's on a timer and triggers so your work colleagues
       | wonder wth is going on.
        
         | dmd wrote:
         | I just get a blank emacs buffer when I run that.
        
           | erk__ wrote:
           | Even if you run it in a buffer that is already full with
           | text? Zone mode only really works if you have text in the
           | buffer.
        
             | dmd wrote:
             | ohhhhhhhhh
        
         | wwarner wrote:
         | dude thanks
        
       | behnamoh wrote:
       | Next time someone donks Python for being incapable of building
       | decent CLI tools, I'll burn their terminal using TTE.
       | 
       | I know Go has the crown for creating TUI apps, but Python isn't
       | that awful. If the app doesn't need concurrency (like a terminal
       | file manager [0] does), then Python is fine.
       | 
       | [0]: Yazzi (Rust) eats Ranger's (Python) lunch and dinner
       | combined.
        
       | benrutter wrote:
       | I freaking love this library! It reminds me of a time that I
       | don't even know happened when computers seemed like a scifi
       | possibility come true. So happy to see it on the front page.
       | 
       | One of the coolest things is not just the ability to pipe cat
       | outputs into it, but that it doubles up as a python library- next
       | time you're making a throw away CLI with print outs and prompts,
       | why not make it insanely jazzy?
        
       | xoac wrote:
       | Someone will add this to their javascript framework cli
        
       | sciencesama wrote:
       | Now we need this in esp32 !!
        
       | filoleg wrote:
       | This is great, thanks!
       | 
       | My favorite is Beams (the one at the very top of the page),
       | reminds me of MGS1 "game over" screen animation a lot.
        
       | keploy wrote:
       | This is cool! we can utilize the 'Burn' or 'ErrorCorrect' effects
       | to highlight warnings or errors in logs dynamically, ensuring
       | critical issues stand out in ongoing terminal output.
        
       | leetrout wrote:
       | I'm glad to see we all take the same approach to these sorts of
       | things ^_^                 self.move_cursor_to_top()
       | sys.stdout.write(output_string)       sys.stdout.flush()
        
         | cl3misch wrote:
         | Would there be a more canonical way do do this?
        
           | nine_k wrote:
           | Back in the day (around 1990) I implemented a gif-like effect
           | for terminals, which happened to be old monochrome hardware
           | terminals on slow (9600?) RS-232 ports, attached to a
           | venerable PDP-11.
           | 
           | It took several text files with ASCII "pictures" (character
           | data only, no control codes, 80x24) as animation frames, and
           | calculated simple per-line "diffs". Then it generated a
           | sequence of cursor movements to only update the affected
           | areas, skipping large parts of the picture.
           | 
           | That made it much faster than the naive overwriting the whole
           | screenfuls from top, with a visible delay between parts of
           | the screen. My version was able to run "simultaneous" small
           | animations quickly at distant parts of the screen, because
           | they took very few bytes to navigate to and update.
           | *          *.        * o/       -/M         _H_
           | 
           | E.g. a "juggler" like this could juggle quickly, inside a
           | mostly stationary "circus", with "flags" waving high above on
           | top of it.
           | 
           | With current terminals giving you 60fps in true-color mode,
           | it makes little sense, of course.
        
           | deathanatos wrote:
           | Not redrawing the parts of the screen that don't need to be
           | redrawn. There's going to be a tradeoff between the amount of
           | works the terminal has to do parsing the input stream, the
           | amount of work the terminal has to do to redraw/update its
           | own buffer, and the amount of work necessary in the program
           | to compute the necessary move commands.
           | 
           | IIRC, ncurses does this under the hood.
        
       | throwanem wrote:
       | This is amazing! Please never ever use it in production.
        
         | distortionfield wrote:
         | Idk I wouldn't mind one or two of these as loading screens or
         | something.
        
           | JTyQZSnP3cQGa8B wrote:
           | As a developer-only tool, I'm sure most of my coworkers would
           | love the attention to details.
        
             | PartiallyTyped wrote:
             | I actually love it.
        
             | throwanem wrote:
             | As a product engineer, I'd love the attention to detail
             | much more when placed toward changes that improve my
             | ability to sustain velocity, than when toward changes that
             | actively cut against that.
        
           | johnmaguire wrote:
           | What CLI tools have a slow enough boot to require a loading
           | screen? I'm sure there are some but...
           | 
           | The only one that comes to mine for me is FileBot[0] - and if
           | the loading screen made it take ANY additional time, I'd be
           | annoyed.
           | 
           | [0] https://www.filebot.net/
        
             | distortionfield wrote:
             | Deployment scripts are what come to mind for me. I wouldn't
             | mind a cool loading screen that highlighted problem nodes
             | in the burning font or something when I deploy to dev /
             | test / hell, maybe even prod.
        
           | traverseda wrote:
           | No. I still sometimes need to use a TTY over MOSH over a
           | satellite connection.
           | 
           | No.
        
         | ykonstant wrote:
         | Why not?
        
           | throwanem wrote:
           | Imagine that the CLI tool you use most often every day - a
           | compiler, a package manager, like that - adds animations like
           | these in common operations. Now you have to wait for the
           | animation to finish before you can continue your work. How do
           | you feel about that?
        
             | makapuf wrote:
             | Of course it would be obnoxious.
             | 
             | As an "about" screen, or in a opt-in funny theme why not !
        
             | ykonstant wrote:
             | ?? Why would I imagine that? What does this have to do with
             | using animations in production? What you are saying is "how
             | would you feel about using animations in inappropriate
             | places?"
        
               | yjftsjthsd-h wrote:
               | > What does this have to do with using animations in
               | production? What you are saying is "how would you feel
               | about using animations in inappropriate places?"
               | 
               | Production will always be an inappropriate place. QED.
        
             | Szpadel wrote:
             | I actually did some color animations to status bar of build
             | tool I created while ago. In my opinion this distracted
             | enough to make build feel faster
             | 
             | Edit: popular example of less invasive animations would be
             | new docker cli, (pulling, buildx build)
        
               | throwanem wrote:
               | Yeah. Animations covering time that'd be spent either way
               | I see no problem with, so long as it's obvious the time
               | _would_ be spent either way. Animations that _waste_ my
               | time, not so much.
               | 
               | Better than either, of course, would be effort spent on
               | speeding up the build in the first place. I realize
               | that's less fun, though.
               | 
               | In general, the critical development path is not a place
               | to thoughtlessly _add_ friction.
        
             | reddalo wrote:
             | Also, I don't want to even imagine how it would look on a
             | SSH connection.
        
             | distortionfield wrote:
             | It's trivial to add in a keypress that short circuits the
             | animation. God, this website is full of the grumpiest
             | people on the planet.
        
               | cornstalks wrote:
               | It's not grumpy to prefer function over form in a tool.
               | People optimize for different things. GP's comment is
               | reasonable; they're optimizing for something different
               | than you.
        
           | yjftsjthsd-h wrote:
           | Prod should be as robust and straightforward as possible; no
           | distractions, no noise, no extra overhead. This is _neat_ ,
           | but not useful, and it adds distractions and delays.
        
         | echelon wrote:
         | These are beautiful.
         | 
         | What I'd really like to see is this supported in the terminal
         | emulator itself as an idle mode, i.e. don't run this in the
         | buffer directly, but rather as a second buffer. This could
         | function like a "screen saver". Once you interact, your primary
         | terminal would be fully restored.
        
           | hedora wrote:
           | s/fully/gradually/
           | 
           | I'd love some of these effects to fade in/out within live
           | terminal sessions.
        
         | jdoss wrote:
         | I was thinking about how fun it would be to add this my Python
         | CLI [0] I made for launching Fedora CoreOS locally with QEMU
         | for testing ignition, but with a flag that is turned off by
         | default. Using the burn effect in TTE when launching a VM with
         | my CLI would be so cool.
         | 
         | This instantly reminded me about Ansible and how it annoyed me
         | that ANSIBLE_NOCOWS had to be enabled to disable the default
         | output of Ansible with cowsay [1].
         | 
         | [0]: https://github.com/quickvm/bupy
         | 
         | [1]: https://github.com/ansible/ansible/issues/10530
        
         | barryrandall wrote:
         | Please use this to reboot Trade Wars 2002.
        
           | harwoodr wrote:
           | Oddly enough, I was just thinking about that sort of thing...
        
           | flir wrote:
           | BBS Doors! I knew this reminded me of something (in a good
           | way).
        
         | Aldipower wrote:
         | You do not know how my production looks like. I _will_ use it
         | in production!
        
           | layer8 wrote:
           | You work on screensavers?
        
             | hedora wrote:
             | Don't we all?
             | 
             | https://xkcd.com/722/
        
         | layer8 wrote:
         | Who wants to actually read text anyway.
        
         | notnmeyer wrote:
         | all my run books use this
        
         | neilv wrote:
         | I propose that developers are allowed to use it in
         | production... so long as they do all the development work on a
         | 9600 baud dialup with a VT102.
        
           | neilv wrote:
           | A few years ago, a submarine cable was knocked out, between
           | our startup's MVP servers in Singapore AWS, and our networked
           | factory stations in Asia.
           | 
           | In lieu of the submarine cable, something closer to a wet
           | string was being routed over. It had such high latency and
           | packet loss, that a watchdog timer I'd implemented on the
           | stations was timing out.
           | 
           | Fortunately, the remote access we'd built into our stations
           | (SSH and OpenVPN) still worked, albeit at slow speeds, like a
           | 300 baud dialup, and crazy-high latency.
           | 
           | Having occasionally dealt with performance a bit like that as
           | a kid, and knowing my way around Linux, it was like "I've
           | been training my whole life for this moment."
           | 
           | So I just flexed the old command-line-and-editor-when-you-
           | feel-every-byte-transmitted skill, and got the stations
           | working, before the factory even knew about the submarine
           | cable, saving our infinite-9s uptime.
           | 
           | It was nothing compared to what NASA does, but terminal
           | animation effects would've ended both of our missions.
        
             | Dylan16807 wrote:
             | I think my first action in a situation like that would be
             | an attempt to install mosh from a local mirror.
        
               | throwanem wrote:
               | That needs a binary to run on the remote host for
               | protocol support, doesn't it? I wonder how long _that 'd_
               | take to get transferred and running, over as slow a link
               | as it sounds like this was.
        
         | 1propionyl wrote:
         | Agreed. It's not nearly as battle-tested as key operations
         | tooling like `sl` and `gti`.
        
       | terminaltrove wrote:
       | The effects on this project is incredible, thanks for building
       | this!
        
       | bredren wrote:
       | These effects remind me of some of the first programming I ever
       | did: animated ASCII art for local BBS's.
       | 
       | I remember dumping an entire day into something resembling
       | Spider-Man. Was very exciting when a sysop put my work into their
       | login sequence.
        
       | guidoism wrote:
       | Reminds me of the drip.com TSR program that I put on some of the
       | school computers circa 1990.
        
         | glonq wrote:
         | Yeah in 1991 our college lab's MSDOS PC's were unsecured
         | (unsecurable!?), so our prof quickly learned to regret teaching
         | us how to write TSR's in ASM.
        
       | makach wrote:
       | oh how fun this must have been to implement these effects.
       | absolutely love it!
        
       | nickdothutton wrote:
       | So much energy going into the command line/terminal at the
       | moment. Reminds me a lot of BBS art of my youth. Where are my
       | TheDraw crew?
        
       | vunderba wrote:
       | These effects would pair really well with an old school bbs/mud
       | simulation.
        
       | TeeMassive wrote:
       | Kind of tools I wish I had a use case for.
        
       | cbm-vic-20 wrote:
       | There's a bit of lag on my VT420.
        
       | eliasson wrote:
       | Wow, this is astonishing!
        
       | influx wrote:
       | Code looks very clean, congrats. I wish for selfish reasons this
       | was written in Go, so I could stuff the binary somewhere easily
       | :)
        
       | glonq wrote:
       | All gorgeous, but I'd like to see more quick/simple ones like
       | 'Expand' because the slower ones would probably become tedious
       | real quick after the initial novelty wears off.
        
         | x187463 wrote:
         | Dev here: I agree, it's actually a line item in my todo list.
         | That being said, many of them can be made to be very quick via
         | command line arguments without losing the spirit of the effect.
        
       | junon wrote:
       | Chalk maintainer here. These are incredible. Some of the best
       | I've ever seen. Kudos.
        
       | sghiassy wrote:
       | What magic sorcery are you using here!?!
       | 
       | Bravo!
        
       | liveoneggs wrote:
       | brings the magic of an ANSI BBS to your terminal and more
        
         | aryeshalev wrote:
         | Exactly what I was thinking. Used to make ANSI animation with
         | THEDRAW back in the day
        
       | p2hari wrote:
       | This is so cool. Thanks for this.
        
       | jhallenworld wrote:
       | The descriptions are fun. So it needs the "Bounty Bob Stikes
       | Back!" effect: birds deliver each letter, then stand proudly on
       | top of the sign:
       | 
       | https://www.youtube.com/watch?v=18n-MBlVIvw
        
       | redconfetti wrote:
       | truly l337
        
       | MikeTheGreat wrote:
       | This is awesome. I'm like 99% sure I saw some of these effects in
       | some of my late-80's CRPG type games :)
       | 
       | It looks like the color gradient is per-pixel, not per-character.
       | Would anyone have any idea how the package does that?
        
         | chuckadams wrote:
         | Barring a zoomed screenshot that shows otherwise, I'm quite
         | certain it's per-character. Operating in true color mode is
         | what makes the color transitions smooth enough to make the
         | optical illusion work.
        
       | g3ol4d0 wrote:
       | fucking amazing
        
       | buildsjets wrote:
       | Rather reminds me of Nick Black's Notcurses library.
       | 
       | https://nick-black.com/dankwiki/index.php/Notcurses
       | 
       | https://github.com/dankamongmen/notcurses
        
         | buildsjets wrote:
         | Video Demo: https://www.youtube.com/watch?v=dcjkezf1ARY
        
       | jamboca wrote:
       | Amazing, does this type of thing exist for like my website that i
       | can use in a css or something i can import? What a cool style...
       | or if it doesn't exist how might we make something like that?
        
       | porcoda wrote:
       | Wow - this is very cool and gives me strong nostalgia for
       | Commodore-64/128 demos and old-school BBS's. I remember spending
       | hours on my Commodore 64 doing this sort of thing by hand for the
       | little BBS that I ran out of my bedroom.
        
       | TazeTSchnitzel wrote:
       | If ascii art animation brings joy to you, you might enjoy "BB:
       | the portable demo". On Debian, it's `sudo apt install bb` I
       | think.
        
       | gary_0 wrote:
       | No "The Matrix" effect? That was one of the earliest programs I
       | wrote back in 2000, and I was so proud of myself.
        
         | hinkley wrote:
         | I can tell I'm too old now because I expected the Matrix
         | projection to be in the first four examples and it's not even
         | on the page.
        
           | gary_0 wrote:
           | It's not me that's too old, it's the world that's too young.
        
           | akira2501 wrote:
           | I was hoping for the "no more secrets" effect.
           | 
           | https://www.youtube.com/watch?v=F5bAa6gFvLs
        
             | hinkley wrote:
             | _Peace on Earth, and goodwill toward men._
             | 
             | I'll see what I can do.
        
             | x187463 wrote:
             | The decrypt effect is a faithful recreation of that exact
             | scene at the 45 second mark. Just different colors, which
             | can be set.
             | 
             | Here it is with adjusted colors:
             | 
             | ls -latr | tte decrypt --ciphertext-colors 808080 --final-
             | gradient-stops 1e90ff
        
         | x187463 wrote:
         | TTE dev here:
         | 
         | Haha, a matrix effect is actually in progress. I want it to be
         | as close to the original as possible. Most implementations
         | actually miss some subtle details. I've watched the original
         | effect in a clip repeatedly and it has surprised me with its
         | complexity beyond what I originally thought. Sometimes the
         | characters shift in place but other times the entire column
         | drops. The top characters in a given column change brightness
         | in interesting ways, too. It'll be in a future release, for
         | sure.
        
       | verst wrote:
       | Looks amazing!
       | 
       | Does anyone know why the "ColorShift" style doesn't animate as
       | shown? When I run this each row cycles through colors from top to
       | bottom, but there is no left to right / right to left color
       | change at all. That's the only style not rendering correctly
       | among 10 different ones I tried.
       | 
       | I tried with iTerm2 and Terminal app.
        
         | x7001 wrote:
         | That demo isn't actually the default config. Here's how you can
         | recreate it.
         | 
         | ll | tte colorshift --travel --travel-direction radial --loop
        
       | divbzero wrote:
       | Awesome! Someone please use this in a film or TV show.
        
       | alfalfasprout wrote:
       | Now this is the kind of stuff I want to see more of on HN. Really
       | cool!
        
       | hinkley wrote:
       | I'm imagining several genres of text based adventures that could
       | make very good use of this library. Cyberpunk, fantasy, and
       | horror.
       | 
       | Very subtle uses of this could go a long way.
        
       | jasonjmcghee wrote:
       | Would love to see a falling sand simulator- many of the effects
       | look like great candidates for making it feel satisfying.
        
       | nickstinemates wrote:
       | I integrated this[1] with my MOTD on ssh login.. :) With random
       | effect each time.
       | 
       | 1: https://keeb.dev/static/login.mp4
        
         | dxxvi wrote:
         | looks both cool and frustrating :)
        
           | nickstinemates wrote:
           | It would be if I logged in a lot! and you can always ctrl+c
           | if you're in a hurry.
        
         | shibeprime wrote:
         | Cool use case! How do you make it choose a random effect?
        
           | nickstinemates wrote:
           | I wrote a simple shell script which does it for me
        
       | adr1an wrote:
       | Can't wait to find these in TV shows!
        
         | Bytamine wrote:
         | Yeah, I can see some "hacker" using Decrypt effect.
        
       | kstrauser wrote:
       | "Why's everyone upvoting some article about text? ... OMG I LOVE
       | THIS."
       | 
       | That's brilliant. I love it. This is the kind of whimsical thing
       | done purely for the love of it that makes my day.
        
       ___________________________________________________________________
       (page generated 2024-05-28 23:00 UTC)