Process Groups, Sessions, and Controlling Terminals
A summary of UNIX’s process groups, sessions, & controlling terminals and how to work with them
A summary of UNIX’s process groups, sessions, & controlling terminals and how to work with them
When using ANSI escape sequences to style text on a terminal, you may need to know exactly what the default foreground & background colors — the ones set with \e[39m and \e[49m — are, as knowing whether the user’s terminal is light-on-dark or dark-on-light can help you pick an appropriate color theme. Fortunately, the escape sequences supported by xterm and compatible terminals include sequences for doing just that.
When using ANSI escape sequences to manipulate a compatible terminal, you may need to know where the text cursor is currently located on the screen, especially if its current location was set by the user or a previous program rather than your code. Fortunately, the ANSI escape sequence standard ECMA-48 provides a sequence for doing just that.