I usually open lxterminal with bash shell where I usually type tmux command first.

I'd like to have launched tmux command automatically, so I tried to add this command to ~/.bash_profile or to ~/.profile files but none of them launched the tmux automatically.

Can this be achieved?

  • 1
    Launch lxterm -e tmux instead? – Ulrich Dangel May 26 '12 at 12:59
  • It's lxterminal. When I run lxterminal -e tmux, alias in ~/.bash_aliases for tmux is not applied and it has no advantage, I still would have to type tmux instead of being launched automatically after bash. – xralf May 26 '12 at 13:05
  • sorry i assumed lxterm equals lxterminal. The normal solution is to change this in your window manager and automatically launch it when you start a terminal – Ulrich Dangel May 26 '12 at 13:13

It's really not recommended to do what you wanted , usually I place something similar for ttyX , edit yor bashrc , add the following lines , which will allow any XTERM based terminal to launch tmux on start.

[[ $TERM = "xterm" ]] && { tmux && exit 0; }

You should add a new shortcut or launch terminal with custom shell , which is tmux. ( not sure if lxterm support this )

| improve this answer | |
  • This starts tmux whenever you run bash in an X terminal. That's very invasive: it means you can never run an interactive shell in an X terminal outside tmux. – Gilles 'SO- stop being evil' May 28 '12 at 1:05

Change your menu entries, keybindings, shell aliases, or whatever you use to run Lxterminal to run lxterminal --command tmux.

Adding tmux to ~/.profile or ~/.bash_profile is no good: these files are read only when you log in. Adding tmux to ~/.bashrc is no good either: that would start tmux in any instance of bash, not just the ones started by lxterminal.

| improve this answer | |
  • I usually start lxterminal via dmenu launcher, I'm not sure if it supports some aliases. – xralf May 28 '12 at 14:57

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.