Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

On first session, tmux says "no current session"

Tags:

tmux

Whenever I open tmux for the first time, it throws the following error.

/home/user/.tmux.conf:67: no current window

The relevant parts of the conf file are as follows.

 52 set-window-option -g window-status-fg "#666666"
 53 set-window-option -g window-status-bg default
 54 set-window-option -g window-status-attr default
 55 set-window-option -g window-status-current-fg red
 56 set-window-option -g window-status-current-bg default
 57 set-window-option -g window-status-current-attr default
 58 set-option -g message-fg white
 59 set-option -g message-bg black
 60 set-option -g message-attr bright
 61 set -g status-left " "
 62 set -g status-justify left
 63 setw -g window-status-format         ' #(echo "[#{window_index}]#{window_name}") '
 64 #setw -g window-status-current-format         ' #(echo "[#{window_index}]#{window_name}") '
 65 setw -g window-status-current-format ' #(echo "#{window_name}") '
 66 set -g status-right "#(echo $(date))"
 67 set allow-rename off
 68 set -sg escape-time 0

This error appears only for the first session I open, for subsequent sessions, the error does not appear.

like image 550
Haran Rajkumar Avatar asked Apr 23 '19 05:04

Haran Rajkumar


People also ask

How do I start tmux in Shell?

Configure Terminal to start tmux by defaultbash_profile shell startup file, just above your aliases section. Save the file and close it. Then close and reopen the terminal to start using tmux by default, every time you open a terminal window.

What is tmux in terminal?

tmux is a terminal multiplexer: it enables a number of terminals to be created, accessed, and controlled from a single screen. tmux may be detached from a screen and continue running in the background, then later reattached. When tmux is started it creates a new session with a single window and displays it on screen.


1 Answers

You don't have -g on that set command so it needs a window to set the option on, but no windows exist yet.

like image 89
Nicholas Marriott Avatar answered Sep 27 '22 01:09

Nicholas Marriott