Sessions
Prev
Next

Sessions

If you often have to log into remote machines, or always run a similar set of terminal applications, you can use Konsole's “Session” feature along with KDE's session management to automate a lot of this for you. Let's take the following example: You often have open an ssh session to the machine administration ready for generic administration tasks. You may have noticed the New Session button on Konsole's tab bar contains a menu if you click and hold on it, and you can choose new session types here. We are going to add new entries to this menu.

  1. Click on the menu entry Settings->Configure Konsole...

  2. Choose the Session tab.

  3. Fill in the first entry with a name. This is the name that will show in the menu, and will be the default label instead of Shell when you start a session of this type.

  4. Enter a command just as you normally would if you opened a new shell and were going to issue that command. For our first example above, you might type ssh administration.

  5. On the lower part of the panel, configure this session's appearance. You can have a different font, colour scheme, and $TERM type for each session.

  6. Press the Save Session... button. A dialog will ask you to confirm the filename.

  7. Press OK.

You should now be able to press and hold the New Session button on the tab bar, and select your new session type from the list. A new shell session will open within the Konsole window, with the result of your executed command. In our example, you will be at an ssh passphrase prompt, and when you provide your passphrase, you will be logged into the remote machine. [1] Perhaps you want to remotely tail your http error logs on a webserver, you could use a commandline something like ssh -f webserver tail -f /var/log/httpd-error.log.

You can use this to execute local commands as well. Try creating a session where the command is tail -f /var/log/messages. In this case, exiting the running application will close the shell session as well.

One really nice use of this feature is if you find you always have the same set of open sessions, KDE can open them all for you automatically when you start a new KDE session. Simply have them open as you like when you exit KDE, and they will be saved with your KDE session, and restored just like any other application when you restart KDE.

Note

You can assign shortcuts to any session.



[1] You can avoid this step also, by using ssh-agent, but that is a topic for another goodie.

Prev
Next
Home


Would you like to make a comment or contribute an update to this page?
Send feedback to the KDE Docs Team