4 ms·
To make things portable look up termcap(5) and tput(1) to ask the termcap database for the right control sequence for your terminal, and use those.
by froh 5y ago
To make things portable look up termcap(5) and tput(1) to ask the termcap database for the right control sequence for your terminal, and use those.
- julienpalard 5y agoInterestingly apt don't do this, they hardcode sequences as I did. Maybe they bet those sequences are the same on all terminals since 1970, espacially those marked "DEC Private" and it won't change soon? I honestly don't know.
- froh 5y agoMost terminal emulations follow the ANSI terminal https://en.m.wikipedia.org/wiki/ANSI_escape_code https://en.m.wikipedia.org/wiki/ANSI_escape_code , so these hard coded escape sequences simply happen to work on most virtual terminals, including windows console (running CMD) and windows terminal.