A line that arrives like a wave β and erases like one.
A single-row C++ wipe effect for the terminal, with a four-stage shade trail and a full-screen clean sweep, all in true color.
sclide is designed for POSIX terminals (Linux, macOS, BSD, WSL) and requires ANSI escape codes and 24-bit true-color support.
The library ships with no external dependencies. The only POSIX-specific calls are terminal-size detection (ioctl + TIOCGWINSZ) and direct writes (write). Everything else is standard C++.
The only requirements are:
- ANSI escape code support
- 24-bit true-color support
- A terminal whose width and height can be queried
If your platform exposes terminal size and honors ANSI escapes, sclide works there.
sclide handles the wave. Where it lands is up to you.
- Overview
- Features
- The Wipe Model
- The Four Shades
- Architecture
- Quick Start
- Use Cases
- Why sclide
- Comparison
- Design Philosophy
- API Reference
- License
sclide is a single-row wipe effect for the terminal. It draws a horizontal line at a row of your choosing, pulls it across the screen with a fading trail behind it, and then β when you ask β sweeps the whole screen clean in the same motion, top to bottom.
The name is a play on "slide" and "ASCII" β but with a nod to sclide, the wipe itself. Not a slide. Not a scroll. A moving bar of light that clears the way in front of it and erases what's behind.
Terminals are full of moments. A loading screen, a banner fading in, a screen clearing before the next thing. Most of the time, those moments are instant β the text appears, the text vanishes, no in-between.
sclide gives that in-between a body. The wipe arrives with a gradient of shades behind it, then erases with the same wave, top to bottom, leaving nothing behind but the cursor blinking on a clean screen.
- One line of motion. That's the whole idea.
- A shade trail that sells the speed. Four characters, four colors, trailing the head of the wipe.
- Full true color. The line's color and the shade's fading color are both fully yours.
- A clean sweep on demand. Call
clean()and the whole terminal is wiped in the same language.
sclide doesn't want to draw your UI. It wants to clear the stage β and make clearing it feel like something.
- 24-bit True Color β Full RGB for both the line and the shade trail
- Hex or RGB Input β Set colors with
#RRGGBBor(r, g, b) - Two Independent Colors β The head of the wipe and the tail of the wipe are set separately
- Automatic Interpolation β The four shade stops are computed from your two endpoints
- Four-Stage Shade Trail β
β β β βfading toward the background - Precomputed Frames β Every rendered frame is a single
write()call - Adjustable Speed β One value controls how long each stage lingers
- Full-Screen Clean β The same wipe language applied top-to-bottom
- One Class β Construct it, set colors, call
clean() - Runtime Restyling β Change the line color, shade color, or glyphs mid-run
- Replaceable Shades β Swap
β β β βfor any four characters - Terminal-Aware β Reads width and height on construction
sclide is built on a single abstraction: a horizontal wipe that erases what it passes.
THE WIPE
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ββββ ββββ ββββ βββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
shade4 shade3 shade2 head (line color)
βββ tail βββ€ the line the wipe leaves behind
β
βββ the wipe's head, moving right
Stage 1: only the head exists.
Stage 2: head + first shade.
Stage 3: head + first + second shade.
Stage 4: head + first + second + third shade.
After: the full line is drawn.
Once the line is on screen, calling clean() replays the same language β but down the screen, row by row, with a leading space to erase the text underneath.
A wipe has three parts:
ββββββββββββββββββββββββββββββββββββββββββββββββ
β A WIPE β
β β
β head β the solid line (β) in the β
β sclide color β
β β
β trail β up to four shade characters β
β fading toward the β
β degrading color β
β β
β sweep β a leading space that β
β erases the cell underneath β
β as the wipe passes β
β β
ββββββββββββββββββββββββββββββββββββββββββββββββ
That's it. Head, trail, sweep. Everything else is timing and color.
The wipe's trail is made of four shade characters, each tinted by a color between the line color and the degrading color.
| Stage | Glyph | Color |
|---|---|---|
| Head | β |
sclide color |
| Shade 1 | β |
100% sclide β 0% degrading |
| Shade 2 | β |
75% sclide β 25% degrading |
| Shade 3 | β |
50% sclide β 50% degrading |
| Shade 4 | β |
25% sclide β 75% degrading |
The degrading color is what the shade fades toward. If you set it to black (#000000), the trail fades into darkness. If you set it to your terminal's background color, the trail fades into invisibility. If you set it to another bright color, the trail becomes a gradient between two hues.
The interpolation is linear per channel, clamped to [0, 255], and computed once per color change β not per frame.
sclide wipe(5);
wipe.setSclideColor("#00FFAA"); // the line itself
wipe.setShadeDegradingColor("#001111"); // what the trail fades into
wipe.clean();βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Application Layer β
β ββββββββββββββββ ββββββββββββββββββ βββββββββββββββββ β
β β Constructor β β setColor() β β clean() β β
β ββββββββββββββββ ββββββββββββββββββ βββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Color Interpolation β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β sclideColor + shadeDegradingColor β β
β β β β β
β β four shade stops, precomputed as ANSI strings β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Precomputed Frames β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β fullLinePreMade β’ firstShadePreMade β β
β β secondShadePreMade β’ thirdShadePreMade β β
β β fourthShadePreMade β’ spacePreMade β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Terminal Layer β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Cursor positioning β’ Foreground color β β
β β Single write() per frame β’ Cursor hide/restore β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
Terminal Display
sclide does almost all of its work before the animation starts. It builds six pre-rendered strings on construction β one for each shade stage, one for the full line, one for the blanking space. Then each frame is a single write() of a string that already exists.
That's the "fast track." No per-cell looping during the animation. No string concatenation per frame. Just cursor positioning and one write.
- C++11 or higher compiler
- POSIX terminal β Linux, macOS, BSD, WSL
- 24-bit true-color support β Most modern terminals handle this
- ANSI escape code support β For cursor positioning
sclide is a single C++ class. Drop it into your project.
# Clone or copy sclide.cpp into your project
# Compile with optimizations
g++ -O3 -std=c++11 your_app.cpp -o your_app
# Run
./your_app#include "sclide.cpp"
int main() {
// starting row
sclide wipe( 5);
wipe.setSclideColor("#00FFAA");
wipe.setShadeDegradingColor("#001111");
wipe.setSpeed(0.05); // seconds per stage
wipe.clean();
return 0;
}That's it. The wipe draws, fades, and clears the screen below it.
A sclide wipe across the top of the terminal, then a clean sweep as the program finishes. The transition is the feedback.
Wipe the terminal between two screens the way a video editor wipes between two shots β except it's all one row of characters.
Draw a header line with sclide, then wipe the body of the terminal clean as your program initializes. The "clean" is both literal and theatrical.
Give the setup process a moment of motion before the first question. A wipe that clears the screen is a wipe that says "we're starting now."
Cutscenes, level transitions, death screens β anywhere a scene change should feel like a scene change.
clear is instant. sclide is a beat. Sometimes the beat is the point.
Most terminal programs treat screen-clearing as a utility: call clear, get on with it. sclide treats it as a gesture.
It doesn't want to render your UI. It doesn't want to own your input loop. It doesn't want to be a TUI framework. It wants to be one line and one sweep β the moment between two states of the screen.
If you have a transition in your terminal app that currently just... happens, sclide is what happens instead.
| sclide | clear / printf |
TUI Frameworks | Graphics Libraries | |
|---|---|---|---|---|
| Dependencies | None | None | Several | Many |
| Setup | One class | Trivial | Framework to learn | Build system, drivers |
| What It Does | Wipe + clean | Instant clear | Full-screen UI | Full-screen pixels |
| True Color | Yes | No | Varies | N/A |
| Motion | 4-stage shade trail | None | Possible, manual | N/A |
| Runs in Terminal | Yes | Yes | Yes | No |
| Learning Curve | Minutes | Seconds | Hours to days | Days to weeks |
| Scope | One wipe | One clear | Everything | Everything |
sclide isn't trying to replace clear. It's trying to make clear feel like something.
sclide is small on purpose.
- It does one wipe.
- It uses one line and four shades.
- It exposes one method for clearing:
clean(). - It precomputes everything it can before the animation starts.
The whole effect is a single idea β "a line that erases what it passes" β applied twice: once across a row, once down the screen. Nothing more.
You're supposed to tune it. Change the line color. Change the degrading color. Slow it down, speed it up. Replace the block shades with something else. The source is short enough to read in one sitting, and the effect is simple enough to reshape in an afternoon.
It's a wipe for people who want the transition to be part of the experience β not just the space between two screens.
sclide(int startingRow);Creates a sclide wipe that draws at row startingRow. On construction, it reads the terminal size, precomputes all six frame strings, and interpolates the four shade colors.
startingRowβ 1-indexed row where the wipe begins
int setSclideColor(int r, int g, int b);
int setSclideColor(std::string hexCode);Sets the color of the head of the wipe. Accepts either raw RGB or a #RRGGBB hex string. Recomputes the shade interpolation immediately.
int setShadeDegradingColor(int r, int g, int b);
int setShadeDegradingColor(std::string hexCode);Sets the color the shade trail fades toward. Accepts either raw RGB or #RRGGBB. Recomputes the shade interpolation immediately.
int resetSclideColor();Resets the head color to white (#FFFFFF).
int setSpeed(double newSpeed);Sets the delay between stages, in seconds. Default is 0.1.
int changeShades(std::vector<std::string> newShades);Replaces the four shade glyphs. Defaults are {"β", "β", "β", "β"}. Rebuilds all precomputed frames.
int clean();Runs the full wipe animation:
- Draws the wipe across
startingRowin four stages. - Sweeps down the screen, row by row, erasing as it goes.
- Finishes with a smooth tail animation on the last visible row.
- Restores the cursor and resets color.
Returns 0 on success.
sclide is inspired by the text-wipe effect from Hired Guns (DMA Design, 1993), discovered through a Reddit discussion about recreating the effect in modern terminal software.
The Reddit discussion and a comment by u/FilesFromTheVoid were the direct inspiration for turning that observation into a standalone implementation.
sclide is an independent C++ implementation inspired by that visual technique; it is not affiliated with or endorsed by the original developers.
--
Licensed under the MIT License. See LICENSE for details.
One line. One sweep. One transition.
"The wipe arrives like a wave β and erases like one."




