mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-21 14:03:18 -07:00
* debian/rules, usr/bin/byobu.in, usr/bin/byobu-launcher.in,
usr/bin/ctail, usr/lib/byobu/include/select-session.py: - silence some checkbashisms false positives - handle nesting a bit differently - allow nesting, by default - detect the infinite loop situation, where we're ssh'ing into ourselves, and handle it gracefully - ensure we have access to 256 colors, even when nesting
This commit is contained in:
parent
e4f17403ec
commit
2a59d62e62
6 changed files with 19 additions and 25 deletions
9
debian/changelog
vendored
9
debian/changelog
vendored
|
@ -1,6 +1,13 @@
|
||||||
byobu (5.89) unreleased; urgency=medium
|
byobu (5.89) unreleased; urgency=medium
|
||||||
|
|
||||||
* UNRELEASED
|
* debian/rules, usr/bin/byobu.in, usr/bin/byobu-launcher.in,
|
||||||
|
usr/bin/ctail, usr/lib/byobu/include/select-session.py:
|
||||||
|
- silence some checkbashisms false positives
|
||||||
|
- handle nesting a bit differently
|
||||||
|
- allow nesting, by default
|
||||||
|
- detect the infinite loop situation, where we're ssh'ing into
|
||||||
|
ourselves, and handle it gracefully
|
||||||
|
- ensure we have access to 256 colors, even when nesting
|
||||||
|
|
||||||
-- Dustin Kirkland <kirkland@ubuntu.com> Thu, 08 Jan 2015 16:01:27 -0600
|
-- Dustin Kirkland <kirkland@ubuntu.com> Thu, 08 Jan 2015 16:01:27 -0600
|
||||||
|
|
||||||
|
|
2
debian/rules
vendored
2
debian/rules
vendored
|
@ -8,7 +8,7 @@ override_dh_auto_build:
|
||||||
# Check shell syntax
|
# Check shell syntax
|
||||||
sh -n `find . -type f -exec grep -l "^\#\!/bin/sh" '{}' \;`
|
sh -n `find . -type f -exec grep -l "^\#\!/bin/sh" '{}' \;`
|
||||||
# Check for bashisms in shell scripts
|
# Check for bashisms in shell scripts
|
||||||
checkbashisms `find . -type f -exec grep -l "^\#\!/bin/sh" '{}' \;` || true
|
checkbashisms `find . -type f -exec grep -l "^\#\!/bin/sh" '{}' \;` 2>&1 | grep "^possible bashism in " | grep -v "sleep only takes one integer" | grep -v "sourced script with arguments" || true
|
||||||
dh_auto_build
|
dh_auto_build
|
||||||
|
|
||||||
override_dh_perl:
|
override_dh_perl:
|
||||||
|
|
|
@ -30,9 +30,14 @@ if [ -O "$HOME" ]; then
|
||||||
case "$TERM" in
|
case "$TERM" in
|
||||||
*screen*)
|
*screen*)
|
||||||
# Handle nesting
|
# Handle nesting
|
||||||
if [ -n "$LC_BYOBU" ] && [ "$LC_BYOBU" -gt 1 ]; then
|
if [ -n "$LC_BYOBU" ] && [ "$LC_BYOBU" -gt 0 ]; then
|
||||||
# LC_BYOBU > 1, so user explicitly wants nested sessions
|
# User explicitly wants nested sessions
|
||||||
exec $BYOBU_PREFIX/bin/byobu "$@"
|
if [ -n "$SSH_CONNECTION" ] && [ "$(printf "$SSH_CONNECTION" | awk '{print $1}')" != "$(printf "$SSH_CONNECTION" | awk '{print $3}')" ]; then
|
||||||
|
# Safeguard against ssh-ing into ourself, which causes an infinite loop
|
||||||
|
exec $BYOBU_PREFIX/bin/byobu "$@"
|
||||||
|
else
|
||||||
|
true
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
true
|
true
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -110,7 +110,7 @@ case $BYOBU_BACKEND in
|
||||||
tmux)
|
tmux)
|
||||||
# Use 256 colors if possible
|
# Use 256 colors if possible
|
||||||
if $BYOBU_TEST tput >/dev/null; then
|
if $BYOBU_TEST tput >/dev/null; then
|
||||||
if [ "$(tput colors 2>/dev/null || echo 0)" = "256" ] || [ "$COLORTERM" = "gnome-terminal" ] || [ "$TERM" = "xterm" ] || [ "$TERM" = "xterm-256color" ]; then
|
if [ "$(tput colors 2>/dev/null || echo 0)" = "256" ] || [ "$COLORTERM" = "gnome-terminal" ] || [ "$TERM" = "xterm" ] || [ "$TERM" = "xterm-256color" ] || [ "$TERM" = "screen" ]; then
|
||||||
[ -z "$SCREEN_TERM" ] && SCREEN_TERM="-2"
|
[ -z "$SCREEN_TERM" ] && SCREEN_TERM="-2"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
if command -v ccze >/dev/null 2>&1; then
|
if which ccze >/dev/null 2>&1; then
|
||||||
tail -F $@ | ccze -A
|
tail -F $@ | ccze -A
|
||||||
else
|
else
|
||||||
echo "ERROR: ccze not found, hint..." 1>&2
|
echo "ERROR: ccze not found, hint..." 1>&2
|
||||||
|
|
|
@ -102,24 +102,6 @@ def attach_session(session):
|
||||||
else:
|
else:
|
||||||
os.execvp("screen", ["", "-AOxRR", session_name])
|
os.execvp("screen", ["", "-AOxRR", session_name])
|
||||||
|
|
||||||
# Confirm nested session, if necessary
|
|
||||||
if os.getenv("BYOBU_NESTING", "0") != "1":
|
|
||||||
if (BYOBU_BACKEND == "tmux" and os.getenv("TMUX")) or (BYOBU_BACKEND == "screen" and "screen" in os.getenv("TERM")):
|
|
||||||
sys.stderr.write("WARNING: Sessions should be nested with care.\n")
|
|
||||||
try:
|
|
||||||
nest = raw_input("Are you sure you want to run Byobu inside another session? [y/N]: ")
|
|
||||||
if nest != "Y" and nest != "y":
|
|
||||||
sys.exit(1)
|
|
||||||
else:
|
|
||||||
if os.getenv("TMUX"):
|
|
||||||
os.unsetenv("TMUX")
|
|
||||||
except KeyboardInterrupt:
|
|
||||||
sys.stdout.write("\n")
|
|
||||||
sys.exit(1)
|
|
||||||
except:
|
|
||||||
sys.stdout.write("\n")
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
sessions = get_sessions()
|
sessions = get_sessions()
|
||||||
|
|
||||||
show_shell = os.path.exists("%s/.always-select" % (BYOBU_CONFIG_DIR))
|
show_shell = os.path.exists("%s/.always-select" % (BYOBU_CONFIG_DIR))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue