Running Linux, 5th Edition - Matthias Kalle Dalheimer [58]
konsole allows you to run several sessions in one konsole window. You can simply open a new session by selecting a session type from the Session menu or by clicking the New tab button. The tab bar or the View menu lets you then switch between sessions. If you don't see any tab bar, select Settings → Tab Bar (and then either Top or Bottom) from the menu to make it visible.
Cutting and pasting selections
Actually, konsole offers a good deal more than a VT100 terminal. One of its features is a powerful cut-and-paste capability.
Take another look at Figure 3-4. Let's say we didn't really want the notes directory; we wanted to look at ~/perl_example/for_web_site instead.
First, we'll choose the part of the cd command that interests us. Put the mouse just to the left of the c in cd. Press the left mouse button, and drag the mouse until it highlights the slash following example. The result is shown in Figure 3-5.
When the highlighted area covers just the right number of characters, click the middle button.[*] konsole pastes in what you've selected on the next command line. See the result in Figure 3-6. Now you can type in the remainder of the directory name for_website and press the Enter key to execute the command.
You can select anything you want in the window—output as well as input. To select whole words instead of characters, double-click the left mouse button. To select whole lines, triple-click it. You can select multiple lines too. Selecting multiple lines is not useful when you're entering commands but is convenient if you're using the vi editor and want to cut and paste a lot of text between windows.
Figure 3-5. Selected text in konsole
Figure 3-6. konsole window after text is pasted
Note that if you are more used to the drag-and-drop style of copying text, konsole supports that as well.
Copying and pasting of text is even integrated between konsole and the graphical KDE applications. For example, if you are viewing a directory with the Konqueror file manager/web browser, you can just drag those icons to a konsole window. konsole will either offer to paste the filenames as they are or prepend them with a cd, cp, mv, or ln command.
More konsole tricks
There are lots of things you can configure in konsole. You can select fonts, color schemes, whether the scrollbar should be shown to the left, to the right, or not at all, and so on. The most often used settings are available in the Settings menu, and if you can't find what you are looking for, go to Settings → Configure Konsole. There you can select the line spacing, whether the cursor should blink, and so on.
A particularly useful feature in konsole is the ability to watch for output or silence in one of the sessions.
What is this feature good for? Imagine that you are working on a large program that takes a long time to compile. Nonprogrammers can imagine that you download a large file in a terminal window with wget or that you are computing a complex POVRAY image. While the compilation is running, you want to do something else (why do you have a multitasking operating system, after all?) and start composing an email message to a friend in your KDE mail client. Normally, you would have to check the console window every so often to see whether compilation is finished and then continue to work on your program. With the watcher, you can get a visual or audible notification when compilation completes. In order to set this up, simply switch to the session you want to watch and select View → Monitor for Silence. You will get a notification as soon as your compiler doesn't output any more messages for a while and can divert your attention from your mail client back to your konsole window. Of course, you can also watch for output instead of silence,