The Random Thread

Does anyone know the historical basis for the ^T ^O keys? This function has to be written into various user programs and it takes effort to maintain these, etc. I'm just curious to know more about the reasoning behind these? I find them convenient at times but they seem specific to FreeBSD and perhaps to older UNIX.

I like them a lot. Getting a progress report without having to ask for them at startup is convenient.

Only problem is that some people are tempted to use printf in the signal handler, which is not legal.
 
In FreeBSD there is a convention where one can type ^T or ^O (Control-T, Control-O) in the midst of the run of various programs (will use DD as an example). ^T will request some sort of runtime statistics from the program and ^O will temporarily suspend output to the terminal.

These two are in addition to the much more widely used ^S and ^Q, ^U, etc. As far as I can tell only FreeBSD still supports ^T and ^O. These keys don't do anything in any Linux I've used.

Does anyone know the historical basis for the ^T ^O keys? This function has to be written into various user programs and it takes effort to maintain these, etc. I'm just curious to know more about the reasoning behind these? I find them convenient at times but they seem specific to FreeBSD and perhaps to older UNIX.
Check out pages 7 (^O) and 20 (^T) of the following 1975 DECsystem-10 manual. DECsystem-10 was not Unix (as far as I know), and yet it incorporated these commands, which seem to be part of an earlier set of terminal conventions. Anyway, the document is what's cooler.

 
The keys generate special interrupts? Via the shell?

They are signals and they are executed as signal handlers in the target program.

Signal handlers have restrictions on what code can be executed in them. One restriction is that they cannot use malloc(3), which precludes use of printf. Without printf it is more difficult to print things like percentages.
 
[...] Signal handlers have restrictions on what code can be executed in them. One restriction is that they cannot use malloc(3) [...]
This is the part I didn't know. Thank you!

And thanks also to Alfredo with the DECSystem-10 (TOPS-10?) information. I remember using ^T and ^O in TOPS-20 but that's old knowledge and I didn't remember it until your reminder. :)
 
Back
Top