From 76560f004dcd8aa287550e0732d6b25d46113ef5 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Wed, 11 Apr 2018 10:16:45 -0500 Subject: [PATCH] * usr/lib/byobu/include/constants, usr/share/byobu/keybindings/f- keys.screen, usr/share/byobu/keybindings/f-keys.tmux: - create a $BYOBU_EDITOR variable, using "sensible-editor" if found (it will be on Debian/Ubuntu systems), or $EDITOR if not, and falling back to "vim" in the case where none are found - use $BYOBU_EDITOR with Shift-F7 to open the printscreen buffer in a new window; this fixes a bug on some distros where $EDITOR might be undefined --- debian/changelog | 9 ++++++++- usr/lib/byobu/include/constants | 3 +++ usr/share/byobu/keybindings/f-keys.screen | 4 ++-- usr/share/byobu/keybindings/f-keys.tmux | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 57a372b7..0b849718 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,13 @@ byobu (5.126) unreleased; urgency=medium - * UNRELEASED + * usr/lib/byobu/include/constants, usr/share/byobu/keybindings/f- + keys.screen, usr/share/byobu/keybindings/f-keys.tmux: + - create a $BYOBU_EDITOR variable, using "sensible-editor" if found + (it will be on Debian/Ubuntu systems), or $EDITOR if not, and falling + back to "vim" in the case where none are found + - use $BYOBU_EDITOR with Shift-F7 to open the printscreen buffer in + a new window; this fixes a bug on some distros where $EDITOR might + be undefined -- Dustin Kirkland Fri, 16 Mar 2018 10:09:57 -0700 diff --git a/usr/lib/byobu/include/constants b/usr/lib/byobu/include/constants index dcd8efa7..f9c2368f 100755 --- a/usr/lib/byobu/include/constants +++ b/usr/lib/byobu/include/constants @@ -47,6 +47,9 @@ esac eval $BYOBU_TEST gsed >/dev/null 2>&1 && export BYOBU_SED="gsed" || export BYOBU_SED="sed" eval $BYOBU_TEST greadlink >/dev/null 2>&1 && export BYOBU_READLINK="greadlink" || export BYOBU_READLINK="readlink" eval $BYOBU_TEST sensible-pager >/dev/null 2>&1 && export BYOBU_PAGER="sensible-pager" || export BYOBU_PAGER="less" +eval $BYOBU_TEST sensible-editor >/dev/null 2>&1 && export BYOBU_EDITOR="sensible-editor" || export BYOBU_EDITOR="$EDITOR" +eval $BYOBU_TEST "$BYOBU_EDITOR" >/dev/null 2>&1 || export BYOBU_EDITOR="vim" + # Check sed's follow-symlinks feature $BYOBU_SED --follow-symlinks "s///" /dev/null 2>/dev/null && BYOBU_SED_INLINE="$BYOBU_SED -i --follow-symlinks" || BYOBU_SED_INLINE="$BYOBU_SED -i" diff --git a/usr/share/byobu/keybindings/f-keys.screen b/usr/share/byobu/keybindings/f-keys.screen index 010d604b..1471c60e 100644 --- a/usr/share/byobu/keybindings/f-keys.screen +++ b/usr/share/byobu/keybindings/f-keys.screen @@ -74,7 +74,7 @@ bindkey "^[[19;5~" eval 'process x' 'process u' # Ctrl-F8 | Re-title a session # No ctrl-shift-F8 (save layout) in Screen bindkey -k k9 $BYOBU_BACKEND -t config 0 byobu-config # F9 | Configuration register s "[g G$>^h" # Goes with Shift-F7 and F12 ~ definition -bindkey "^[[18;2~" eval 'process x' 'process s' 'exec $BYOBU_SED_INLINE -e "/./,/^$/!d" $BYOBU_RUN_DIR/printscreen' '$BYOBU_BACKEND -t PRINTSCREEN $EDITOR $BYOBU_RUN_DIR/printscreen' # Shift-F7 | write the buffer to file, open in a new window +bindkey "^[[18;2~" eval 'process x' 'process s' 'exec $BYOBU_SED_INLINE -e "/./,/^$/!d" $BYOBU_RUN_DIR/printscreen' '$BYOBU_BACKEND -t PRINTSCREEN $BYOBU_EDITOR $BYOBU_RUN_DIR/printscreen' # Shift-F7 | write the buffer to file, open in a new window # F10 | 'toolbar' in gnome-terminal # F11 | 'Full Screen' in gnome-terminal # No alt-F11 (break pane) in Screen @@ -84,7 +84,7 @@ bindkey -k F2 process x # F12 | Byobu's escape key bind $ $BYOBU_BACKEND -t status 0 byobu-status-detail # F12 $ | show detailed status bind @ $BYOBU_BACKEND -t config 0 byobu-config # F12 @ | Configuration bind R process r # F12 R | Reload profile -bind ~ eval 'process x' 'process s' 'exec $BYOBU_SED_INLINE -e "/./,/^$/!d" $BYOBU_RUN_DIR/printscreen' '$BYOBU_BACKEND -t PRINTSCREEN $EDITOR $BYOBU_RUN_DIR/printscreen' # F12 ~ | write the buffer to file, open in a new window +bind ~ eval 'process x' 'process s' 'exec $BYOBU_SED_INLINE -e "/./,/^$/!d" $BYOBU_RUN_DIR/printscreen' '$BYOBU_BACKEND -t PRINTSCREEN $BYOBU_EDITOR $BYOBU_RUN_DIR/printscreen' # F12 ~ | write the buffer to file, open in a new window register d ":source $BYOBU_PREFIX/share/byobu/keybindings/f-keys.screen.disable^M" bind ! eval 'process x' 'process d' 'backtick 111 9999999 9999999 byobu-status menu --disable-f-keys' # F12 ! | toggle on/off f-keys diff --git a/usr/share/byobu/keybindings/f-keys.tmux b/usr/share/byobu/keybindings/f-keys.tmux index 525b3158..2e0eca04 100644 --- a/usr/share/byobu/keybindings/f-keys.tmux +++ b/usr/share/byobu/keybindings/f-keys.tmux @@ -62,7 +62,7 @@ bind-key -n M-F6 run-shell '$BYOBU_PREFIX/lib/byobu/include/tmux-detach-all-but- bind-key -n S-F6 run-shell 'exec touch $BYOBU_RUN_DIR/no-logout' \; detach bind-key -n C-F6 kill-pane bind-key -n F7 copy-mode -bind-key -n S-F7 capture-pane -S -32768 \; save-buffer "$BYOBU_RUN_DIR/printscreen" \; delete-buffer \; new-window -n "PRINTSCREEN" "$EDITOR $BYOBU_RUN_DIR/printscreen" +bind-key -n S-F7 capture-pane -S -32768 \; save-buffer "$BYOBU_RUN_DIR/printscreen" \; delete-buffer \; new-window -n "PRINTSCREEN" "$BYOBU_EDITOR $BYOBU_RUN_DIR/printscreen" bind-key -n M-NPage copy-mode \; send-keys NPage bind-key -n M-PPage copy-mode \; send-keys PPage bind-key -n F8 command-prompt -p "(rename-window) " "rename-window '%%'"