I have a little command line tool and would like to set the terminal name to the task that is currently running in there. I’m mostly using it in zsh in Git Bash in Windows Terminal so that’s most important to me. Right now, my terminal just automatically shows the name of the program. I googled a bit on how this generally works and just running echo -ne "\033]0;foo\007"; sleep 1
on the command line does work for me. In Zig, I tried stdout.print("\\033]0;foo\\007", .{})
and stdout.print("\x0033]0;foo\x0007", .{})
, but both just printed stuff to he terminal and the name was not affected. Any ideas?
Update: Okay, I’m now guessing that I could solve my use case by modifying some zsh config to set the title to the full command with arguments instead of just the command. Still wondering if/how this can be done from Zig.