summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Leferry 2 <alexherbo2@gmail.com>2020-06-28 11:59:52 +0200
committerAlex Leferry 2 <alexherbo2@gmail.com>2020-06-28 11:59:52 +0200
commitfb8c7c5bd8ed16435efe7a54563e69b080a08b96 (patch)
tree5a4236c13ceff073a8e07db1a0dc1a7d8ba9f7be
parent99feddbbf8b53b029ca2bf20558a10c45f0e26ef (diff)
commands/buffer: Fix the edit function to attach to terminal
-rwxr-xr-xrc/paths/commands/buffer8
1 files changed, 7 insertions, 1 deletions
diff --git a/rc/paths/commands/buffer b/rc/paths/commands/buffer
index 0bf9df0..b4b7228 100755
--- a/rc/paths/commands/buffer
+++ b/rc/paths/commands/buffer
@@ -24,7 +24,13 @@ edit() {
kak_quoted_buffer=$(kak_escape "$buffer")
commands="buffer $kak_quoted_buffer; $commands"
done
- send "$commands"
+ # Attach to terminal.
+ # Ensure there is a terminal.
+ if test -t 1 -a "$KAKOUNE_CONNECT_ATTACH" = true; then
+ kak -c "$KAKOUNE_SESSION" -e "$commands"
+ else
+ send "$commands"
+ fi
}
main "$@"