I would like to change the default shell in each terminal emulator separately. To clarify, I want xterm to use tcsh, pterm to use pysh, gnome-terminal to use bash, etc. Is this possible? If so, how can this be accomplished?


Each terminal emulator has its custom way to select which shell to run:

  • gnome-terminal has the run a custom command instead of my shell field in the profile editor.
  • xterm (and pterm) uses xrdb database to store its configuration but do not allow to configure the command to run. You could write a simple shell script that wraps the xterm executable to give him an executable parameter.
  • konsole has the command field in the profile editor.

So you need to discover, by reading the manual, how (and if) each terminal emulator can be configured. There is no common way :-(

If you need only a simple way to choose which shell to run, I strongly suggest you to choose a terminal emulator that supports profiles (like gnome-terminal) and to create a different profile for each shell type. This way you'll can launch a new tab or window running the needed shell by the gnome-terminal internal menu (and, as bonus, choose a different text color for each shell).


As a quick and contained solution, you could make a wrapper script.

case "$1" in
   xterm) shell=/bin/tcsh ;;
   pterm) shell=/bin/pysh ;;
   gnome-terminal) shell=/bin/bash ;;
       printf "Not supported: %s\n" "$1" >&2
       exit 1

SHELL="$shell" "$1"

Just use it as such: thescript <terminal_emulator>.

It's generally preferable to configure each terminal emulator individually though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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