|
|
Control+T in Terminal shows time snapshot
Yup. Or, for a program that will run long enough to get in a good test, any GUI program will work, since it runs until you quit it from the GUI. I couldn't resist trying the rest of them to see if there were any other gems I didn't know about. There are all the usuals: Control-M and Control-J create a CR or LF (nominally respectively, though I'm not sure what the practical difference is here). Control-C sends a kill signal to the current process (not a hard kill though). Control-V followed by another letter lets you type other control characters in. The most interesting one I found though was Control-Z, which (at least for the GUI app that I was trying) sent it a SIGSTOP and detached it from the terminal. SIGSTOP causes most programs to suspend and stop using CPU cycles (resume them with a SIGCONT), and detaching from the terminal is like running followed by an & - the command will still print any output to the terminal, but you have the shell back to do other things while you wait for it to be done. I was curious if these (control-z, control-t) are Mac OS specific, or typical of most Unix OSes, so I googled, and found this page which is rather informative: Edited on Jan 27, '12 08:03:49AM by arcticmac
Control+T in Terminal shows time snapshot
To resume a program you have stopped with ^Z, you have two options:
Control+T in Terminal shows time snapshot
or something like "killall -CONT processname"
Control+T in Terminal shows time snapshot
Control-M and Control-J create a CR or LF (nominally respectively, though I'm not sure what the practical difference is here).There is no difference. In ASCII, Control-M (also written ^M) is CR and Control-J (^J) is LF. For example, a pure Unix terminal program can't tell the difference between you typing ^M vs return. Control-V followed by another letter lets you type other control characters in.That's more to do with the command-line editor you're currently using than the shell, i.e., that's what you type in vi. ---
- Paul
Control+T in Terminal shows time snapshot
Any Unix program can see the CR's and LF's separately if the programmer chooses. They just have to turn off icrnl or put the tty into raw mode. To say that there is no difference between the two is a little misleading.
Example: #!/bin/sh stty -icrnl echo "Type something, hit control M or enter/return a few times, then hit control J" read ans echo "You typed:" echo $ans | od -a stty icrnlAlso, control V is the usual setting for the tty's "literal next" (lnext) setting and is not limited to command line editors. Try running a simple command like sleep 30, then hit ^V^M and ^V^J to see that there is a difference between the two.In Terminal the key labelled "return" will produce the same results as hitting ^M because they're both ways to generate a carriage return (CR). If icrnl is on (see stty -e) then these will be mapped to newlines.
Control+T in Terminal shows time snapshot
"detaching from the terminal is like running followed by an & " |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.06 seconds |
|