Skip to content

Commit

Permalink
Consolidate tmux hooks and bind kill-pane to q w/o prefix key - req…
Browse files Browse the repository at this point in the history
…uires tmux 2.1+ (based on github pull request #130 by Stefan Bühler @stbuehler).
  • Loading branch information
liske committed Oct 21, 2017
1 parent 91c09b0 commit 53886e5
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 41 deletions.
8 changes: 6 additions & 2 deletions ChangeLog
@@ -1,7 +1,11 @@
apt-dater (1.0.4) unstable; urgency=low

* Travis CI: use docker for recent Debian build environment
(github issue #139 by Lukas Kallies @kallies)
* tmux
- bind kill-pane to `q` w/o prefix key (requires tmux 2.1+)
(github pull request #130 by Stefan Bühler @stbuehler)
* Travis CI:
- use docker for recent Debian build environment
(github issue #139 by Lukas Kallies @kallies)
* Bugfixes:
- Fix Tcl filters never matching due to broken return code handling.
- Do not fail on make install on updating due to symlinks creation.
Expand Down
2 changes: 1 addition & 1 deletion Makefile.in
Expand Up @@ -161,7 +161,7 @@ CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(top_srcdir)/build/apt-dater.spec.in ABOUT-NLS AUTHORS \
COPYING ChangeLog INSTALL NEWS README.md TODO compile \
COPYING ChangeLog INSTALL NEWS README TODO compile \
config.guess config.rpath config.sub depcomp install-sh \
missing mkinstalldirs
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
Expand Down
2 changes: 1 addition & 1 deletion lib/Makefile.am
@@ -1,4 +1,4 @@
EXTRA_DISTS=cmd hosts2xml ssh-addonce tmux-bind-q-kill-pane tmux-hint pcre-less
EXTRA_DISTS=cmd hosts2xml ssh-addonce tmux-hint pcre-less

install-exec-hook:
$(mkinstalldirs) $(DESTDIR)$(pkglibdir)
Expand Down
2 changes: 1 addition & 1 deletion lib/Makefile.in
Expand Up @@ -292,7 +292,7 @@ target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRA_DISTS = cmd hosts2xml ssh-addonce tmux-bind-q-kill-pane tmux-hint pcre-less
EXTRA_DISTS = cmd hosts2xml ssh-addonce tmux-hint pcre-less
all: all-am

.SUFFIXES:
Expand Down
16 changes: 0 additions & 16 deletions lib/tmux-bind-q-kill-pane

This file was deleted.

24 changes: 4 additions & 20 deletions lib/tmux-hint
Expand Up @@ -28,32 +28,16 @@ if [ -z "$TMUX_PANE" ]; then
exit 0
fi

KEY_QUIT='q'

case "$AD_ACTION" in
refresh)
exit 0
;;

*)
tm_pref=$(tmux show-options -gv prefix)
tmux list-keys | grep 'kill-pane$' | (
keys=""
while read bindkey optt table key cmd; do
[ "${bindkey}" != "bind-key" ] && continue
[ "${optt}" != "-T" ] && continue
if [ "${table}" = "prefix" ]; then
key="${tm_pref} ${key}"
elif [ "${table}" != "root" ]; then
continue
fi
if [ "${keys}" = "" ]; then
keys="${key}"
else
keys="${keys} or ${key}"
fi
done
: ${keys:=${tm_pref} :kill-pane <enter>}
echo "=== Session terminated, press ${keys} to close pane. ===" 1>&2
)
tmux bind-key -T root $KEY_QUIT kill-pane
echo "=== Session terminated, press '$KEY_QUIT' to close pane. ===" 1>&2
exit 0
;;
esac

0 comments on commit 53886e5

Please sign in to comment.