screen/byobu presence inferred by an environment variable
Bug #1179304 reported by
Jan Dahl
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu Server Guide |
New
|
Undecided
|
Unassigned |
Bug Description
Hey there,
I've recently discovered that $STY is set when running a terminal in byobu (or screen). I think i would be suitable to add to the documentation (https:/
Proposed addition:
You can check for the presence of byobu in your scripts by checking for the $STY environment variable, e.g.
<pre>if [ -n $STY ]; then...</pre>
affects: | ubuntu-docs (Ubuntu) → serverguide |
To post a comment you must log in.
Here's an example script that I use (from my own repo: https:/ /github. com/jandahl/ updateScreenWin dowTitles)
#!/usr/bin/env bash
# If running in screen, set trap to fall back to current hostname {HOSTNAME} \033\\" ' 0 1 2 15
# If you want it to blank, replace ${HOSTNAME} with a space :-)
if [ -n $STY ] ; then
trap 'echo -n -e "\033k$
echo -n -e "\033k$1\033\\"
fi
/usr/bin/env ssh $*