-1

I am on Ubuntu 16.04. Very often, the first thing I do when starting to work on a new task is open a new terminal with the shortcut Ctrl - Alt - T and then type tmux.

I would like to skip the typing of tmux. I found several solutions in which one appends the bashrc, but it sounds like this may break the system, which frightens me (see the warning in the second link):

https://unix.stackexchange.com/questions/43601/how-can-i-set-my-default-shell-to-start-up-tmux

How can I make TMUX be active whenever I start a new shell session?

How may I safely open a new terminal with tmux using a shortcut, without risking to damage my system?

Zorglub29
  • 6,979
  • 6
  • 20
  • 37
  • This may help: https://stackoverflow.com/a/36152028/10248678 – oguz ismail Dec 11 '18 at 09:45
  • Ok, not very clear what to do in details from this. By the way, why downvote? – Zorglub29 Dec 11 '18 at 09:47
  • Not sure who downvoted, but I know several people around me who were wondering how to do this - and this is the reason why I posted this question + answer. I agree that for a bash / ubuntu advanced user this is a trivial question, but this may be useful for people with less experience who are not too familiar with personalized shortcuts and command line tweaks. – Zorglub29 Dec 11 '18 at 09:50
  • I'm not the downvoter. – oguz ismail Dec 11 '18 at 09:51
  • 1
    Ok, thanks for the information ;) Sometimes get a bit sad when seeing downvote without explanation, but so it is... – Zorglub29 Dec 11 '18 at 09:52

1 Answers1

2

A way to achieve this is to set up a new shortcut. In Ubuntu 16.04, I can:

  • open the Keyboard utility,
  • go to Shortcuts > Custom Shortcuts,
  • create a new shortcut named TmuxTerminal, which launch the command gnome-terminal -e "tmux new", and bind it to for example Ctrl+Alt+M (as Ctrl+Alt+T is my default terminal shortcut which I still want to use now and then, and TMux...).

This way I can launch a tmux terminal by shortcut, without taking the risk of damaging my system. similar tweaks are certainly possible on other versions of Ubuntu / distros.

slava
  • 791
  • 1
  • 11
  • 26
Zorglub29
  • 6,979
  • 6
  • 20
  • 37