You are not logged in.
I'm starting to play with tmux. So far I've read the Arch Wiki article and added a few settings in my ~/.tmux.conf
## Prefix is Ctrl-a
unbind C-b
set -g prefix C-a
bind C-a send-prefix
## Set scrollback buffer
set -g history-limit 10000
## Set the default TERM
set -g default-terminal screen
## Update the TERM variable of terminal emulator when creating a new session or attaching a existing session
set -g update-environment 'DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY TERM'
## Determine if we should enable 256-colour support
if "[[ ${TERM} =~ 256color || ${TERM} == fbterm ]]" 'set -g default-terminal screen-256color'
## Copy tmux paste buffer to CLIPBOARD
bind C-c run "tmux show-buffer | xsel -i -b"
## Copy CLIPBOARD to tmux paste buffer and paste tmux paste buffer
bind C-v run "tmux set-buffer -- \"$(xsel -o -b)\"; tmux paste-buffer"
## Mouse works as expected
setw -g mode-mouse on
set -g mouse-select-pane on
set -g mouse-resize-pane on
set -g mouse-select-window on
I've also made a unit file as the mentioned article suggests because my intention is to run a detached session of tmux in every boot.
~/.config/systemd/user/tmux.service
[Unit]
Description=Start tmux in detached session
[Service]
Type=forking
ExecStart=/usr/bin/tmux new-session -s %u -d
ExecStop=/usr/bin/tmux kill-session -t %u
[Install]
WantedBy=multi-user.target
The problem arises when in enable the service like: systemctl --user enable tmux.service. In the next boot there is no active session (checked with tmux ls) and systemd reports the unit as not loaded (systemctl --user status tmux.service).
But, if I started it manually like systemctl --user start tmux.service, everything goes fine. Any ideas?
I've also read this other topic that is somewhat related to my problem.
Last edited by Jason P. (2015-04-12 21:37:22)
Offline
Enabling that service with that [Install] section created a symlink, right? So when you start multi-user.target, tmux.service will also be started. The thing is, there is no multi-user.target for your user instance of systemd, unless you created one.
If you haven't set up any other targets, you can use default.target instead.
Offline
Enabling that service with that [Install] section created a symlink, right?
Yep. There is a symlink to tmux.service inside ~/.config/systemd/user/multi-user.target
If you haven't set up any other targets, you can use default.target instead.
I was thinking that when I log in as my regular user through gdm I was actually reaching multi-user.target. I mean, the system is supposed to be multi seat ready. It seems I get it the wrong way:
multi-user.target
A special target unit for setting up a multi-user system (non-graphical). This is pulled in by graphical.target.
Offline
It seems I get it the wrong way:
multi-user.target
A special target unit for setting up a multi-user system (non-graphical). This is pulled in by graphical.target.
That seems to be from the man page systemd.special, but it is under SPECIAL SYSTEM UNITS. Further down, there is a (much shorter) list of SPECIAL USER UNITS.
Offline
I've changed multi-user.target to default.target and the service is started as expected. Cool
Maybe this line of the wiki entry about tmux should be clarified:
Alternatively, you can place this file within your systemd/User directory (without User=%I), for example ~/.config/systemd/user/tmux.service. This way the tmux service will start when you log in.
As it is, the unit file doesn't serve for the purpose of starting tmux as a user service.
Offline
How can I mark the thread as solved?
Offline
How can I mark the thread as solved?
Edit the title of the thread & put "[SOLVED]" at the start
Offline
I was looking for an option itself to edit the title. Having to edit the first post is not the most obvious solution I guess.
Anyway, thank you all.
Offline