Skip to content

Commit

Permalink
Make check if running in tty more fuzzy ...
Browse files Browse the repository at this point in the history
...to support e.g. BSD where tty may named ttyv

See #19
  • Loading branch information
loh-tar committed Sep 16, 2022
1 parent 4200d7a commit a9f5b2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tbsm
Original file line number Diff line number Diff line change
Expand Up @@ -922,11 +922,11 @@ IFS=':' read -ra sessionPfads <<< "$sessionPfads"

# Check if running in tty and set X displaynumber
runInTTY=$(tty)
if [[ ! "$runInTTY" =~ /dev/tty[0-9] ]]; then
if [[ ! "$runInTTY" =~ /dev/tty[a-z]*([0-9]) ]]; then
unset runInTTY
else
# Replace @Xdisplay@ with e.g. :1
XserverArg=${XserverArg/@Xdisplay@/:${runInTTY#/dev/tty}}
XserverArg=${XserverArg/@Xdisplay@/:${BASH_REMATCH[1]}}
fi

# Special handling to support GNU style help
Expand Down

0 comments on commit a9f5b2d

Please sign in to comment.