summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2019-03-06 22:48:21 +1100
committerMaxime Coste <mawww@kakoune.org>2019-03-06 22:48:21 +1100
commit800c2c7128ff26efe246f89a65812fbb3dbdbb3e (patch)
treeba94399b94b2829fd18cfa5063827e2fa96a7ed2
parent7c5831780b4d676271db77a9425b2d2b4be051fd (diff)
parentdc8481776c6271278131df45d6fecf4d260f690b (diff)
Merge remote-tracking branch 'occivink/fix-iterm'
-rw-r--r--rc/extra/iterm.kak13
1 files changed, 7 insertions, 6 deletions
diff --git a/rc/extra/iterm.kak b/rc/extra/iterm.kak
index fe32f664..7518d2d0 100644
--- a/rc/extra/iterm.kak
+++ b/rc/extra/iterm.kak
@@ -1,12 +1,13 @@
# https://www.iterm2.com
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
-## The default behaviour for the `new` command is to open an vertical pane in
+## The default behaviour for the `terminal` command is to open a vertical pane in
## an iTerm session if not in a tmux session.
hook global KakBegin .* %sh{
if [ "$TERM_PROGRAM" = "iTerm.app" ] && [ -z "$TMUX" ]; then
echo "
alias global focus iterm-focus
+ alias global terminal iterm-terminal-vertical
"
fi
}
@@ -28,7 +29,7 @@ define-command -hidden -params 2.. iterm-terminal-split-impl %{
# go through another round of escaping for osascript
# \ -> \\
# " -> \"
- escaped=$(printf %s "$args" | sed -e 's|\|\\\\|g; s|"|\\"|g')
+ escaped=$(printf %s "$args" | sed -e 's|\\|\\\\|g; s|"|\\"|g')
cmd="env PATH='${PATH}' TMPDIR='${TMPDIR}' $escaped"
osascript \
-e "tell application \"iTerm\"" \
@@ -41,14 +42,14 @@ define-command -hidden -params 2.. iterm-terminal-split-impl %{
define-command iterm-terminal-vertical -params 1.. -shell-completion -docstring '
iterm-terminal-vertical <program> [<arguments>]: create a new terminal as an iterm pane
-The current pane is split into two, top and bottom
+The current pane is split into two, left and right
The program passed as argument will be executed in the new terminal'\
%{
iterm-terminal-split-impl 'vertically' %arg{@}
}
define-command iterm-terminal-horizontal -params 1.. -shell-completion -docstring '
iterm-terminal-horizontal <program> [<arguments>]: create a new terminal as an iterm pane
-The current pane is split into two, left and right
+The current pane is split into two, top and bottom
The program passed as argument will be executed in the new terminal'\
%{
iterm-terminal-split-impl 'horizontally' %arg{@}
@@ -69,7 +70,7 @@ The program passed as argument will be executed in the new terminal'\
fi
done
)
- escaped=$(printf %s "$args" | sed -e 's|\|\\\\|g; s|"|\\"|g')
+ escaped=$(printf %s "$args" | sed -e 's|\\|\\\\|g; s|"|\\"|g')
cmd="env PATH='${PATH}' TMPDIR='${TMPDIR}' $escaped"
osascript \
-e "tell application \"iTerm\"" \
@@ -95,7 +96,7 @@ The program passed as argument will be executed in the new terminal'\
fi
done
)
- escaped=$(printf %s "$args" | sed -e 's|\|\\\\|g; s|"|\\"|g')
+ escaped=$(printf %s "$args" | sed -e 's|\\|\\\\|g; s|"|\\"|g')
cmd="env PATH='${PATH}' TMPDIR='${TMPDIR}' $escaped"
osascript \
-e "tell application \"iTerm\"" \