User Tools

Site Tools


config:terminal-sharing

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
config:terminal-sharing [2026/11/04 17:23] – created Wuffconfig:terminal-sharing [2026/11/05 14:26] (current) – Wuff
Line 15: Line 15:
  
 # Local desktop tmux wrapper (No-Exit Edition) # Local desktop tmux wrapper (No-Exit Edition)
-if [[ -z "$TMUX" && -z "$SSH_CONNECTION" && -n "$DISPLAY" && $- == *i* ]]; then+if [[ -z "$TMUX" && -z "$SSH_CONNECTION" && -n "$DISPLAY" && $- == *i* && -z "$BASH_EXECUTION_STRING" ]]; then
     # Unique session name     # Unique session name
     SESSION_NAME="term_$(date +%s)_$$"     SESSION_NAME="term_$(date +%s)_$$"
Line 53: Line 53:
 set -g default-terminal "xterm-256color" set -g default-terminal "xterm-256color"
  
 +# Disable status bar
 +set -g status off
 </code> </code>
  
Line 109: Line 111:
 chmod +x ~/.local/bin/term-menu chmod +x ~/.local/bin/term-menu
 </code> </code>
 +
 +
 +Useful commands:
 +<code>
 +# Reload config file
 +tmux source-file ~/.tmux.conf
 +
 +# Kill specific session
 +tmux kill-session -t term_556644
 +
 +# Wipe state clean/kill all sessions
 +tmux kill-server
 +</code>
 +
 +To use tmux via cinnamon applet "ssh launcher", a wrapper script needs to be used:
 +<code bash ~/.local/bin/ssh-tmux>
 +#!/bin/bash
 +# Called by the SSH Launcher applet as: ssh-tmux ssh [flags] <host>
 +host="${@: -1}"
 +name="ssh_${host//[^A-Za-z0-9_-]/_}"
 +exec tmux new-session -A -s "$name" "$(printf '%q ' "$@")"
 +</code>
 +<code bash>
 +chmod +x  ~/.local/bin/ssh-tmux
 +</code>
 +and in the ssh launcher settings, a custom command needs to be set for the terminal launcher. Note that the absolute path with proper username is required here and ~ does not work:
 +<code>
 +gnome-terminal -- /home/USER/.local/bin/ssh-tmux
 +</code>
 +
config/terminal-sharing.1793812997.txt.gz · Last modified: by Wuff