I'm trying to edit my bottom left status section of tmux. I would like it to show
Session: #{session_name}
The current maximum length for this string is set at 20 using this setting
status-left-length 20
This works fine but once I enter a session name that is longer than 20 (including "Session: "), tmux just cuts off the text. I would like process the whole string so that anything longer than 20 characters will show up like this
Session: mysessio...
ie. the string gets trimmed to 20 characters and the last three characters are replaced with dots. I have a working bash script doing what I would like
string="verylongstringfortesting"
lengthLimit=10
if [ ${#string} -gt $lengthLimit ]
then
echo ${string:0:$(($lengthLimit-3))}"..."
fi
how do I go about embedding this in tmux.conf?? I know about #(shell-command) and I have tried #(echo #{session_name}) but that doesn't seem to return the session name.