terminal mode bracketed paste ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

terminal mode bracketed paste ?

M Kelly
Hi,

It seems for me bracketed paste is not enabled in terminal mode.
If I copy a few lines then paste into my zsh outside of vim (in tmux) then bracketed paste is enabled and the lines are not executed until I hit enter.
But if in terminal mode I paste then each line is executed.

Is this possible ?  Is there a config setting I can enable ?
Any help appreciated.
thx,
mark

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: terminal mode bracketed paste ?

Christian Brabandt

On Do, 14 Jun 2018, M Kelly wrote:

> Hi,
>
> It seems for me bracketed paste is not enabled in terminal mode.
> If I copy a few lines then paste into my zsh outside of vim (in tmux) then bracketed paste is enabled and the lines are not executed until I hit enter.
> But if in terminal mode I paste then each line is executed.
>
> Is this possible ?  Is there a config setting I can enable ?
> Any help appreciated.

If you copy, make sure not to include the line ending.

Best,
Christian
--
Ein Pessimist ist ein Optimist, der nachgedacht hat.
                -- Dan Bennet

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: terminal mode bracketed paste ?

IWAMOTO Kouichi
In reply to this post by M Kelly
On Thu, 14 Jun 2018 19:46:45 -0700 (PDT)
M Kelly <[hidden email]> wrote:

> It seems for me bracketed paste is not enabled in terminal mode.
> If I copy a few lines then paste into my zsh outside of vim (in tmux) then bracketed paste is enabled and the lines are not executed until I hit enter.
> But if in terminal mode I paste then each line is executed.

Vim does not enables bracketed paste mode if TERM=screen.
To enable bracketed paste mode when vim runs in tmux, you may add following
setting into .vimrc.

if &term =~ "screen"
    let &t_BE = "\e[?2004h"
    let &t_BD = "\e[?2004l"
    exec "set t_PS=\e[200~"
    exec "set t_PE=\e[201~"
endif

--
IWAMOTO Kouichi ([hidden email]/[hidden email]/[hidden email])

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: terminal mode bracketed paste ?

M Kelly
> Vim does not enables bracketed paste mode if TERM=screen.
> To enable bracketed paste mode when vim runs in tmux, you may add following
> setting into .vimrc.
>
> if &term =~ "screen"
>     let &t_BE = "\e[?2004h"
>     let &t_BD = "\e[?2004l"
>     exec "set t_PS=\e[200~"
>     exec "set t_PE=\e[201~"
> endif

Thank you, works great :-)

take care,
-mark

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: terminal mode bracketed paste ?

Bram Moolenaar
In reply to this post by M Kelly

Mark Kelly wrote:

> It seems for me bracketed paste is not enabled in terminal mode.
> If I copy a few lines then paste into my zsh outside of vim (in tmux) then bracketed paste is enabled and the lines are not executed until I hit enter.
> But if in terminal mode I paste then each line is executed.
>
> Is this possible ?  Is there a config setting I can enable ?
> Any help appreciated.

How exactly do you paste?

I guess when using the middle mouse, which pastes the * register,
the call to start/end bracketed paste is missing.  That is where
insert_reg() is called.

--
hundred-and-one symptoms of being an internet addict:
43. You tell the kids they can't use the computer because "Daddy's got work to
    do" and you don't even have a job.

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: terminal mode bracketed paste ?

M Kelly

> How exactly do you paste?

first -
<C-\><C-n> to get into normal mode
V, select a few lines moving around
yank
back to terminal mode

then -
paste with ctrl-shift-v or with mouse middle button

thx,
-m

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: terminal mode bracketed paste ?

Bram Moolenaar

> > How exactly do you paste?
>
> first -
> <C-\><C-n> to get into normal mode
> V, select a few lines moving around
> yank
> back to terminal mode
>
> then -
> paste with ctrl-shift-v or with mouse middle button

I cannot reproduce this when running Vim in a terminal window.
What do you run, zsh?  How do you start it, with ":term zsh" or with
":term" while 'shell' is set to "zsh"?

And what terminal is Vim running in and what is 'term' set to?

--
hundred-and-one symptoms of being an internet addict:
44. Your friends no longer send you e-mail...they just log on to your IRC
    channel.

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: terminal mode bracketed paste ?

M Kelly
> I cannot reproduce this when running Vim in a terminal window.
> What do you run, zsh?  How do you start it, with ":term zsh" or with
> ":term" while 'shell' is set to "zsh"?
>
> And what terminal is Vim running in and what is 'term' set to?

Hi,

just :terminal
my shell is zsh
TERM=screen-256color
(all from within tmux)

thx,
-m

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: terminal mode bracketed paste ?

Bram Moolenaar

> > I cannot reproduce this when running Vim in a terminal window.
> > What do you run, zsh?  How do you start it, with ":term zsh" or with
> > ":term" while 'shell' is set to "zsh"?
> >
> > And what terminal is Vim running in and what is 'term' set to?
>
> Hi,
>
> just :terminal
> my shell is zsh
> TERM=screen-256color
> (all from within tmux)

In this situation t_BE and t_BD are empty, thus bracketed paste is not
supported.

--
hundred-and-one symptoms of being an internet addict:
48. You get a tatoo that says "This body best viewed with Netscape 3.1 or
    higher."

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: terminal mode bracketed paste ?

M Kelly
Hi,

> In this situation t_BE and t_BD are empty, thus bracketed paste is not
> supported.

Thanks for looking into it.  

Adding this -

if &term =~ "screen"
  let &t_BE = "\e[?2004h"
  let &t_BD = "\e[?2004l"
  exec "set t_PS=\e[200~"
  exec "set t_PE=\e[201~"
endif

is a good solution for me.

thank you so much for vim, and thanks to everyone for all their support,
-m

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.