-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doesn't work with latest tmux #32
Comments
Same issue here. |
We've added and removed tmux specific code a couple of times now — I don't use tmux, and it sounds like it has very complicated handling of terminal escapes (unsurprisingly!). I'd be very happy for anyone to pick this up and figure out exactly what the problem is, but please see also #28 #18 #14 #21 #23 and #25. |
Thanks for the reply. None of these links gives me a working solution. I'm currently trying to fix it by myself. |
I'm bored of tmux general issues for a couple of days, I deleted it. |
😃Sent via SuperhumanOn Thu, Jun 01, 2017 at 3:15 PM, Fabien Duhamel<[email protected]>wrote:I'm bored of tmux general issues for a couple of days, I deleted it.
—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or mute the thread.
|
Just hitted by this. Hope someone can share a solution. |
Just remove all the tmux wraping stuff and it's done. Thanks @nicm ! |
@amosbird how did you fix it? |
If you remove the DCS wrapping it should work in any tmux since tmux/tmux@f4fdddc |
@nicm, you should PR that. |
@nicm I think you are talking about a solution that works with 'tmux paste-buffer -p' as opposed to pasting from the system paste buffer with Command-V? |
No, it is supported for both.
On 11 Jun 2017 7:03 pm, "Von Welch" <[email protected]> wrote:
@nicm <https://github.com/nicm> I think you are talking about a solution
that works with 'tmux paste-buffer -p' as opposed to pasting from the
system paste buffer with Command-V?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#32 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AASkc763xTc3GXzsaP7vyXdHk2sTtgrwks5sDCvUgaJpZM4NPRTG>
.
|
Thanks for clarifying. Like others on this thread, something recently broke indentation pasting from the system pastebuffer into vim running in tmux for me and removing the wrapping (i.e. making |
Show me what you have in your script now. |
Here you go: https://github.com/von-forks/vim-bracketed-paste/blob/master/plugin/bracketed-paste.vim As far as I can tell, |
Looks OK to me. What tmux version? If it is not 2.5 or master then please
upgrade and make sure the problem still exists. If it does, can you please
do
tmux -Ltest -f/dev/null -vvvv new
Then run vim, paste something short, then exit vim and tmux and show me the
tmux-server*.log file from the current working directory.
…On 12 Jun 2017 2:13 am, "Von Welch" ***@***.***> wrote:
Here you go: https://github.com/von-forks/vim-bracketed-paste/blob/
master/plugin/bracketed-paste.vim
As far as I can tell, XTermPasteBegin() is never invoked as I don't see
the message from the echom I added for debugging.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#32 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AASkc32UOsnC1vwU7tj98TyROpnm76vwks5sDJCugaJpZM4NPRTG>
.
|
I am running tmux 2.5 installed via homebrew. And I've noticed my problem comes and goes depending on how I start vim. If I start vim with a file on the command line or loading a session, pasting and indentation is broken. If I start vim without any commandline arguments and then open a file, pasting works without indentation as desired. So I've got some startup weirdness going on and will go debug on my own for a bit. Thanks for your help. |
If I change from setting For clarity, this fixes things for me:
According to Since it might be relevant, I'm running vim 8.0 (patches 1-636), in tmux 2.5, in iTerm 3.0.15. (And this is all with the tmux wrapping removed per #33.) |
OK, reading fd01b5d more carefully, I understand it is about making pasting work from normal and visual mode and sure enough, I confirmed that using |
Vim seems to include support for bracketed paste as of 8.0.0210. Maybe there is some interference that is masked by signalling bracketed paste support on every change to insert mode? Unfortunately I am not able to investigate that right now. |
@nicm's original suggestion worked for me. I simply removed the calls to WrapForTmux This diff works for me on Mac OSX with tmux 2.5 and vim 7.4 diff --git a/plugin/bracketed-paste.vim b/plugin/bracketed-paste.vim
index 196ec9b..17c688f 100644
--- a/plugin/bracketed-paste.vim
+++ b/plugin/bracketed-paste.vim
@@ -24,8 +24,8 @@ function! WrapForTmux(s)
return tmux_start . substitute(a:s, "\<Esc>", "\<Esc>\<Esc>", 'g') . tmux_end
endfunction
-let &t_ti .= WrapForTmux("\<Esc>[?2004h")
-let &t_te .= WrapForTmux("\<Esc>[?2004l")
+let &t_ti .= "\<Esc>[?2004h"
+let &t_te .= "\<Esc>[?2004l"
function! XTermPasteBegin(ret)
set pastetoggle=<f29>
FWIW, I think my diff has the same behavior as the diff in #33 |
Ok. I've gone with @v's solution. Looking forward to new reports of "doesn't work in tmux" :D. |
I can confirm that this doesn't work in tmux, and since vim 8 ships support natively (which works outside tmux), the only real point of a plugin here is to wrap for tmux or to support <8. Maybe worth updating the README to specify that this is for 7.x since it doesn't serve any purpose in 8.x currently FWIW I am able to use bracketed paste mode in zsh inside tmux (2.5), it's only vim (with and without this plugin) that doesn't work in tmux |
Also fwiw this bit of config that I similarly lifted from that SO article actually does make bracketed paste mode work inside of tmux... not sure what that means because I don't even see any tmux-specific code here. But somehow, in vim 8, with this config, I can use bracketed paste mode both inside and outside tmux.
If you are not keen on supporting tmux in your plugin and just want to serve 7.x users I'm fine taking my config and wrapping it up into a different plugin Edit: https://github.com/chrisjohnson/vim8-bracketed-paste-mode-tmux |
I've rolled my own plugin also: https://github.com/ryanpcmcquen/fix-vim-pasting |
Plugin works fine outside tmux, but within tmux same old indentation hell breaks loose.
Any ideas how to fix this?
The text was updated successfully, but these errors were encountered: