]> git.immae.eu Git - perso/Immae/Config/Ansible.git/commitdiff
Add remote session for tmux
authorIsmaël Bouya <ismael.bouya@fretlink.com>
Sun, 18 Nov 2018 12:08:53 +0000 (13:08 +0100)
committerIsmaël Bouya <ismael.bouya@fretlink.com>
Sun, 18 Nov 2018 12:20:49 +0000 (13:20 +0100)
roles/shell/bash/files/bashrc [deleted file]
roles/shell/bash/templates/bashrc.j2

diff --git a/roles/shell/bash/files/bashrc b/roles/shell/bash/files/bashrc
deleted file mode 100644 (file)
index 28d0af9..0000000
+++ /dev/null
@@ -1 +0,0 @@
-coucou
index fabe53fb5ec63f80d0a0529f23a2e1b8bb8ac9fd..08518c9dca101e731573bb85154913c7c132c9d4 100644 (file)
@@ -58,13 +58,17 @@ function tmux_dev() {
 
   case "$type" in
     "bash") start_dir="$HOME";;
+    "remote") start_dir="$HOME";;
     "puppet") start_dir="/etc/puppetlabs/code"
   esac
 
   if tmux has-session -t "$type" 2>/dev/null; then
     tmux $m -t "$type"
   else
-    if [ -n "$start_dir" ]; then
+    if [ "$type" = "remote" ]; then
+      tmux new-session -d -c $start_dir -s "$type" mosh immae.eu \; \
+          $m -t "$type"
+    elif [ -n "$start_dir" ]; then
       tmux new-session -d -c $start_dir -s "$type" \; \
           $m -t "$type" \; \
           new-window -c $start_dir
@@ -83,7 +87,7 @@ _tmux_dev() {
   local cur="${COMP_WORDS[COMP_CWORD]}"
   prefix="$HOME/workdir/"
   local IFS=$'\n'
-  local items=($(IFS=' ' compgen -W "bash puppet" -- $cur) $(compgen -d $prefix$cur))
+  local items=($(IFS=' ' compgen -W "bash remote puppet" -- $cur) $(compgen -d $prefix$cur))
   for item in ${items[@]}; do
     [[ $item == $prefix.* ]] && continue
     COMPREPLY+=("${item#$prefix}")