Some fun using ANSI escape sequences to modify the result of the git log command
Or: How to do crimes against VT100 emulation.
From the UNIX Hater’s Handbook:
Programmers at the revered Digital Equipment Corporation took a very
simple-minded approach to solving the heterogenous terminal problem.
Since their company manufactured both hardware and software, they simply
didn’t support terminals made by any other manufacturer. They then
hard-coded algorithms for displaying information on the standard DEC
VT52 (then the VT100, VT102, an so on) into their VMS operating system,
application programs, scripts, mail messages, and any other system string
that they could get their hands on. Indeed, within DEC’s buildings ZK1,
ZK2, and ZK3, an entire tradition of writing animated “christmas cards”
and mailing them to other, unsuspecting users grew up around the holidays.
(Think of these as early precursors to computer worms and viruses.)
^v<ESC> can also be used directly at a shell prompt, if you want to use git commit -m.
git commit -m
I recommend a shell alias.
alias blink='printf "^[[5m;%s^[0"'
Or whatever it is that actually works. Then:
git commit -a -m `blink "check yo self"`
Why stop there, why not inject terminal escape sequences and change the background color or draw weird fonts on the person’s xterm…
Seems like we could change the terminals title, clear the screen, change the position of the cursor… Basically take total control of what the terminal shows to the user.
I’m going to assume you can disable this by telling git not to use less -R, but I’m not near my desk to experiment.
But then you won’t get colors either! What’s wrong with you???
mutter mutter good taste mutter
OT: Is there a way to make git diff more GitHub-like? I find it near-useless in its default state. Some 256-color magic, maybe?
[Comment removed by author]
Cool, thanks. Looks like that’s part of git core’s contrib since 2013, and there are other “word” options as well: