mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-21 05:53:22 -07:00
Don't pollute output with title if calling from script.
Extracting output from byobu in a script will receive garbage control codes that don't belong. Check if the script is called from a terminal before deciding to send window update control codes.
This commit is contained in:
parent
6f686a2125
commit
236a19a974
1 changed files with 6 additions and 4 deletions
|
@ -93,10 +93,12 @@ fi
|
||||||
# Sanitize the environment
|
# Sanitize the environment
|
||||||
byobu-janitor --force
|
byobu-janitor --force
|
||||||
|
|
||||||
# Set the window title
|
# Set the window title if this is a TTY
|
||||||
|
if [ -t 1 ]; then
|
||||||
[ -r "$BYOBU_CONFIG_DIR/statusrc" ] && . "$BYOBU_CONFIG_DIR/statusrc"
|
[ -r "$BYOBU_CONFIG_DIR/statusrc" ] && . "$BYOBU_CONFIG_DIR/statusrc"
|
||||||
. $BYOBU_PREFIX/lib/$PKG/ip_address
|
. $BYOBU_PREFIX/lib/$PKG/ip_address
|
||||||
[ -n "$BYOBU_NO_TITLE" ] || printf "\033]0;${USER}@$(hostname) ($(__ip_address t)) - ${PKG}\007"
|
[ -n "$BYOBU_NO_TITLE" ] || printf "\033]0;${USER}@$(hostname) ($(__ip_address t)) - ${PKG}\007"
|
||||||
|
fi
|
||||||
|
|
||||||
# Drop a symlink to the ssh socket in $HOME, since we can ensure that exists
|
# Drop a symlink to the ssh socket in $HOME, since we can ensure that exists
|
||||||
if [ -S "$SSH_AUTH_SOCK" ] && [ ! -h "$SSH_AUTH_SOCK" ]; then
|
if [ -S "$SSH_AUTH_SOCK" ] && [ ! -h "$SSH_AUTH_SOCK" ]; then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue