Run Tmux Automatically On Fish Shell

How to configure fish config to run tmux automatically

Add new config file ~/.config/fish/conf.d/ and type,

if not set -q TMUX
set -g TMUX tmux new-session -d -s base
eval $TMUX
tmux attach-session -d -t base

This scripts will check the availability of shell variable TMUX. If not available, fish will set the variable and run it with eval commands. Then tmux will attach to the newly created session.

The newly created session created with a name base

Written by

Software Engineer, Consultant and Father

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store