To display a clock in tmux, press Ctrl+b t. This shows a full-screen digital clock in the current pane. Toggle between digital and analog styles with the A key while the clock is displayed. Exit clock mode by pressing Escape or q.
Ctrl+b t
The clock feature in tmux is a simple utility that can display the current time in either digital or analog format. It takes over the current pane temporarily but doesn't interfere with your running processes.
# Enter clock mode Ctrl+b t # Exit clock mode q # or Escape
You can also enter clock mode using the tmux command interface:
# Enter digital clock mode Ctrl+b :clock-mode
You can customize the appearance of the clock by adding these settings to your ~/.tmux.conf
file:
# Set the clock mode color set-window-option -g clock-mode-colour green # Set the 12-hour style set-window-option -g clock-mode-style 12
The clock-mode-colour
can be set to any color name or hex value that tmux supports.
Instead of using the temporary clock mode, you might prefer to have a permanent clock in your tmux status bar:
# Add time to the right side of status bar set -g status-right '%H:%M %d-%b-%y' # For a more detailed timestamp set -g status-right '%Y-%m-%d %H:%M:%S' # For time with timezone set -g status-right '%H:%M %Z'
The format string follows the standard strftime
format used in many programming languages.