Hi,
`:help terminal-typing` says that:
> 'termwinkey' . send a CTRL-W to the job in the terminal
However, this only works when 'termwinkey' is empty. If 'termwinkey' is set
(even if it is set to <C-W>), `'termwinkey' .` doesn't send anything.
Shouldn't it send 'termwinkey' (not CTRL-W) when 'termwinkey' is set?
There are other differences between the document and the actual behavior:
> CTRL-W CTRL-\ send a CTRL-\ to the job in the terminal
This only works when 'termwinkey' is empty.
Shouldn't `'termwinkey' CTRL-\` send a CTRL-\ ?
> 'termwinkey' CTRL-W move focus to the next window
This doesn't work when 'termwinkey' is explicitly set to <C-W>.
(CTRL-W is sent in that case.)
Please check the attached patch for my proposal.
(Actually, I'm still wondering the behavior of C-W C-W. Currently, it works
differently when 'termwinkey' is set to empty or explicitly to <C-W>.)
Regards,
Ken Takata
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
# HG changeset patch
# Parent 06a8d220080c51c8a5213d1d8d66456326cb9ef1
diff --git a/runtime/doc/terminal.txt b/runtime/doc/terminal.txt
--- a/runtime/doc/terminal.txt
+++ b/runtime/doc/terminal.txt
@@ -83,10 +83,12 @@ Special in the terminal window: *CTRL-
See option 'termwinkey' for specifying another key instead of CTRL-W that
will work like CTRL-W. However, typing 'termwinkey' twice sends 'termwinkey'
to the job. For example:
- 'termwinkey' CTRL-W move focus to the next window
+ 'termwinkey' CTRL-W move focus to the next window (except when
+ 'termwinkey' is explicitly set to <C-W>)
'termwinkey' : enter an Ex command
'termwinkey' 'termwinkey' send 'termwinkey' to the job in the terminal
- 'termwinkey' . send a CTRL-W to the job in the terminal
+ 'termwinkey' . send 'termwinkey' to the job in the terminal
+ 'termwinkey' CTRL-\ send a CTRL-\ to the job in the terminal
'termwinkey' N go to terminal Normal mode, see below
'termwinkey' CTRL-N same as CTRL-W N
'termwinkey' CTRL-C same as |t_CTRL-W_CTRL-C|
diff --git a/src/terminal.c b/src/terminal.c
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -2203,12 +2203,12 @@ terminal_loop(int blocking)
/* "CTRL-W CTRL-C" or 'termwinkey' CTRL-C: end the job */
mch_signal_job(curbuf->b_term->tl_job, (char_u *)"kill");
}
- else if (termwinkey == 0 && c == '.')
+ else if (c == '.')
{
- /* "CTRL-W .": send CTRL-W to the job */
- c = Ctrl_W;
+ /* "CTRL-W .": send CTRL-W (or 'termwinkey') to the job */
+ c = termwinkey == 0 ? Ctrl_W : termwinkey;
}
- else if (termwinkey == 0 && c == Ctrl_BSL)
+ else if (c == Ctrl_BSL)
{
/* "CTRL-W CTRL-\": send CTRL-\ to the job */
c = Ctrl_BSL;