Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Why in the world do all my gnome terminals run under 1 process in Ubuntu? This is integrating things that should remain separated! I much prefer xterm's rational mode of running one process per window.

I tried to switch some auto-started windows from xterm to gnome-terminal so I can freeze a log file from scrolling while I'm looking at it. Unfortunately, I can no longer kill my log windows that are littering my desktop. Just accidentally killed every terminal I had open!!!

  1. Can I kill individual gnome-terminal windows as if they are single shell processes? (you know, like a normal process)
    OR
  2. Can I stop auto-scrolling of tail -f inside an xterm by manually scrolling up, so I can read the log file while it's growing?
share|improve this question
1  
Thanks for your responses. Actually I found the answer in a post from Adam on stackoverflow. gnome-terminal --disable-factory starts a new process with its own PID. Now I can kill such processes when I run my test framework each (next) time. Thanks. –  Brad Doty May 18 '11 at 20:30

3 Answers 3

Whether terminals should be one process or many is an argument for another day, I think killing them as a way to look at scroll back data is a miss-use of technology.

I suggest you look into using GNU screen or tmux. Probably the later since it's actively developed and easier to get going with.

If you run tmux all your terminals you will be able to do crazy ninja tricks like scrolling back through all output, multiple panes and tab in any given terminal, disconnected from one terminal and picking up where you left off in another, full terminal output logging, copy/paste magic, process monitoring, and even being able to kill any given shell tab.

share|improve this answer
    
Thanks for the feedback. I want these logs to scroll, unless the user wants to look at them, then I want to be able to effortlessly pause the scrolling. This happens naturally in xterm when one manually scrolls up a line. The command continues filling up the buffer, but you can look at the data. The scroll button moves up the screen and gets smaller when you're looking at the output, rather than just getting smaller at the bottom. But when I re-run the process, I want to kill all the old windows, which I apparently can't in gnome. –  Brad Doty May 18 '11 at 20:04
    
I see what you're getting at now, your application wasn't clear before. I'm not sure how it's going to be possible without using a different terminal emulator program, but if I think of something I'll add another answer! –  Caleb May 18 '11 at 20:16

To get rid of a single window, use its close button. Or find out the process ID of the program running inside it, and kill it.

All unix terminals have a feature from way back when a terminal was a piece of hardware connected to the computer via a serial port. The terminal could send flow control commands to the computer: “XON” (meaning “stop sending me stuff, I'm not ready”) and “XOFF” (meaning “ok, throw me what you've got”). I normally recommend turning these features off in your terminal configuration (the command is stty -ixon), but in this particular case, they're useful: press Ctrl+S to stop scrolling, and Ctrl+Q to resume.

tail -f isn't the best way to read log files. Try out multitail, which is tail -f with coloring, filters, multiple windows and other stuff. Even if all you want to do is tail one file, run less +F, which turns on less's tail mode. Press Ctrl+C to switch to browsing and F to switch back to tailing.

share|improve this answer

Consider using Ctrl-Z to suspend the tail process and later resume it with fg. In some cases the flow control characters (Ctrl-S to stop, Ctrl-Q to resume) can be used, but they are disabled by default on most modern terminals.

share|improve this answer
    
Last time this came up (I think for gnome-terminal under Ubuntu 10.04), flow control still defaulted on. Note that to resume with fg after Ctrl+Z, you need to be running tail under a shell, not directly in the terminal (if you do that, you need to do kill -CONT $pid to resume). –  Gilles May 18 '11 at 19:21
    
No, that's the point. I am doing this in a script. It seems gnome-terminal was designed to be controlled only in the interactive realm. –  Brad Doty May 18 '11 at 20:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.