Set a default session and use it in case it crashes
This commit is contained in:
parent
576e72e41b
commit
64370f6c0a
@ -11,7 +11,16 @@
|
|||||||
owner: "{{ ansible_user }}"
|
owner: "{{ ansible_user }}"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
|
|
||||||
- name: Use tmux as default shell
|
- name: Use tmux as default shell and attach to existing session
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: /root/.bashrc
|
path: /root/.bashrc
|
||||||
line: 'case $- in *i*) [ -z "$TMUX" ] && exec tmux;; esac'
|
line: |
|
||||||
|
case $- in
|
||||||
|
*i*)
|
||||||
|
if command -v tmux &>/dev/null; then
|
||||||
|
if [ -z "$TMUX" ]; then
|
||||||
|
tmux attach-session -t default || tmux new-session -s default
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user