|
|
|
|
|
by saagarjha
2308 days ago
|
|
A couple more that I use often: * imgcat: you can view images without leaving your terminal. Somehow this works even across SSH connections… * Python scripting API: basically AppleScript for iTerm except it lets you touch pretty much everything and it's not soul-crushing to write. I have mine switch between themes based on the system appearance (which changes based on the time of day). |
|
The source code[1] is quite simple to read (as long as you know Bash) but basically imgcat prints a special OSC[2] sequence (some bytes that tell the terminal to do something special) to stdout followed by the image data which iTerm then handles specially because of the OSC sequence, as far as SSH knows they're just some bytes that it needs to send (no different than running normal cat on a text file). You can kind of think of this as the opposite of what bracketed paste[3] does, in bracketed paste the terminal tells the program to treat some data specially but with imgcat the program tells the terminal to treat some data specially.
[1]: https://iterm2.com/utilities/imgcat
[2]: https://en.wikipedia.org/wiki/ANSI_escape_code#Escape_sequen...
[3]: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-B...