Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.4: Get status of foreground jobs with ^T Apps
Tiger only hintWhen running processes from Terminal/the shell, the old Unix status control character finally works in 10.4. This is useful for seeing what your process is up to. While waiting for a command to complete, press control-T to see load, command running, pid, status, and user and system CPU time used:
$ sleep 5
/* Press Control-T... */
load: 0.11  cmd: sleep 2559 waiting 0.00u 0.00s
Here's a bash example; Control-T is pressed before each output line appears:
$ while true; do set x=0; done
load: 0.04  cmd: bash 2552 running 1.01u 0.03s
load: 0.04  cmd: bash 2552 running 2.73u 0.04s
load: 0.12  cmd: bash 2552 running 4.29u 0.04s
load: 0.12  cmd: bash 2552 running 6.03u 0.05s
^C
$ 
This feature seems to be enabled by default when you create a new Terminal window, but I had to turn it on manually (by typing stty status ^T, that's literally a ^ and then a T) when sshing.
    •    
  • Currently 2.60 / 5
  You rated: 2 / 5 (5 votes cast)
 
[13,794 views]  

10.4: Get status of foreground jobs with ^T | 13 comments | Create New Account
Click here to return to the '10.4: Get status of foreground jobs with ^T' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Get status of foreground jobs with ^T
Authored by: ghay on Jun 03, '05 10:19:10AM

Sorry, not with tcsh, even if you do try to enable it manually.



[ Reply to This | # ]
10.4: Get status of foreground jobs with ^T
Authored by: ghay on Jun 03, '05 10:20:20AM

Ignore this comment, it was what I was doing, indeed this hint *does* work.



[ Reply to This | # ]
10.4: Get status of foreground jobs with ^T
Authored by: quentinsf on Jun 03, '05 10:36:40AM

Another useful and, I find, little-known, key is Ctrl-U. It deletes back to the beginning of the current line. I use this most often when I realise I've made an error typing a password. Since you can't see what you're typing, and backspaces can sometimes be handled in funny ways, Ctrl-U is the easiest way to start again.

Most people know Ctrl-K (delete to end of line). Another big favourite of mine is Ctrl-T, which swaps the two letters around the cursor; very handy for correcting typos. Ctrl-K and Ctrl-T also work in most Cocoa apps. Ctrl-U doesn't.



[ Reply to This | # ]
10.4: Get status of foreground jobs with ^T
Authored by: GlowingApple on Jun 03, '05 11:36:51AM

Is there any where I can get a list of these commands? I've always used page up in tty's in Gentoo to show me the most recent command beginning with what I currently have typed (i.e. typing ssh and then hitting page up would give me the full command to the last box I ssh'd to). But in Terminal.app it simply scrolls up the output buffer to the previous page of output. I'd love to find out what all the keyboard equivalents are for Terminal.app.

---
Jayson --When Microsoft asks you, "Where do you want to go today?" tell them "Apple."



[ Reply to This | # ]
Emacs key bindsing are universal in os x
Authored by: SOX on Jun 03, '05 11:55:42AM

All of these are a subset of the emacs key-bindings. so look at emacs and you will find a list.

a few of my favorites:
ctrl-a move to begining of line
ctrl-e mode to end of line
ctrl-k cut from cursor to end of line
ctrl-y paste previous cut at cursor

By the way these work in ALL cocoa application text frames. this includes any fill-out form on a webpage, mail.app, text-edit, spotlight,....

also shell specific handy keys are:
ctrl-c kills job
ctrl-z suspends job, retruns prompt; type "fg" to resume it.
ctrl-u kills entire line
ctrl-s halts all screen printing (your jobs may halt too!)
ctrl-q resumes screen printing.




[ Reply to This | # ]
10.4: Get status of foreground jobs with ^T
Authored by: simonpie on Jun 03, '05 02:51:06PM
stty -a

[ Reply to This | # ]
10.4: Get status of foreground jobs with ^T
Authored by: mayo2ca on Jun 03, '05 01:46:52PM

and ctrl+w to delete the last word ...



[ Reply to This | # ]
10.4: Get status of foreground jobs with ^T
Authored by: adrianm on Jun 03, '05 10:46:07AM

Is that bash-specific?



[ Reply to This | # ]
Only in Terminal
Authored by: Tomnibus on Jun 03, '05 11:48:55AM

This only works in Terminal, not iTerm.



[ Reply to This | # ]
Only in Terminal
Authored by: Tomnibus on Jun 03, '05 11:50:07AM

Sorry, read the last addition about doing: stty status ^T and it works in iTerm now.



[ Reply to This | # ]
Only in Terminal
Authored by: Tomnibus on Jun 03, '05 11:59:55AM

Strange, I can get ^T to work in iTerm on the local by doing the "stty status ^T" command. However, when ssh'd to a server it doesn't work. Although the server is running Panther so perhaps that could be why?



[ Reply to This | # ]
10.4: Get status of foreground jobs with ^T
Authored by: jjccgg on Jun 03, '05 08:42:44PM
This has been in OS X since day one. But before, you had to activate it manually:
$ stty status '^T'
The version of bash included with Tiger just does that for you. For zsh, tcsh, or other shells, put the above command in your .tcshrc/.zshrc/equivalent file.

[ Reply to This | # ]
Oops, didn't read to the end
Authored by: jjccgg on Jun 03, '05 08:44:14PM

Yes, I'm an idiot. Serves me right for speed-reading.



[ Reply to This | # ]