zsh-workers
 help / color / mirror / code / Atom feed
* zsh Issue - "Tab" character is not pasted into shell
@ 2016-09-01  8:42 Xavier Martínez Serrano
  2016-09-01 13:48 ` Christian Neukirchen
  0 siblings, 1 reply; 4+ messages in thread
From: Xavier Martínez Serrano @ 2016-09-01  8:42 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 726 bytes --]

Hi all,

I recently experimented an issue when pasting "tab" characters to zsh
terminal. Whereas
changing the shell to "sh" or opening a terminal editor like "nano" allowed
me to paste
a text with tabs, when copying the same text with tabs into "zsh" it
literally EATS the TAB
characters.

I've observed this behaviour in Ubuntu 12.04/14.04 (within Biolinux
distribution).

I hope there is a workaround or some trick I may not know.

Many thanks for your help in advance,
Xavi

Ex:
Text in "Leafpad" (plain text editor):

this<TAB>is<TAB>a<TAB>test

When coyp/pasted (via menu or shortcut(Ctrk+Shift+V) to sh or nano the
output is as expected:

this<TAB>is<TAB>a<TAB>test

But when pasted to "zsh" the output is:

thisisatest

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: zsh Issue - "Tab" character is not pasted into shell
  2016-09-01  8:42 zsh Issue - "Tab" character is not pasted into shell Xavier Martínez Serrano
@ 2016-09-01 13:48 ` Christian Neukirchen
  2016-09-01 16:37   ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Christian Neukirchen @ 2016-09-01 13:48 UTC (permalink / raw)
  To: zsh-workers

Xavier Martínez Serrano <xmarti6@xtec.cat> writes:

> Hi all,
>
> I recently experimented an issue when pasting "tab" characters to zsh
> terminal. Whereas
> changing the shell to "sh" or opening a terminal editor like "nano" allowed
> me to paste
> a text with tabs, when copying the same text with tabs into "zsh" it
> literally EATS the TAB
> characters.

> When coyp/pasted (via menu or shortcut(Ctrk+Shift+V) to sh or nano the
> output is as expected:
>
> this<TAB>is<TAB>a<TAB>test
>
> But when pasted to "zsh" the output is:
>
> thisisatest

Without special copy&paste support, "pasting" just means the terminal
emulator types in the text very quickly, and <TAB> means to do
completion in this case...

That said, recent zsh support terminal copy&paste, so with my zsh 5.2
this works out of the box (setopt zle_bracketed_paste), at least in
urxvt and xterm.

Hope this helps,
-- 
Christian Neukirchen  <chneukirchen@gmail.com>  http://chneukirchen.org


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: zsh Issue - "Tab" character is not pasted into shell
  2016-09-01 13:48 ` Christian Neukirchen
@ 2016-09-01 16:37   ` Bart Schaefer
  2016-09-02  7:21     ` Xavier Martínez Serrano
  0 siblings, 1 reply; 4+ messages in thread
From: Bart Schaefer @ 2016-09-01 16:37 UTC (permalink / raw)
  To: zsh-workers; +Cc: Xavier Martinez Serrano

On Sep 1,  3:48pm, Christian Neukirchen wrote:
} Subject: Re: zsh Issue - "Tab" character is not pasted into shell
}
} Xavier Martinez Serrano <xmarti6@xtec.cat> writes:
} 
} > I recently experimented an issue when pasting "tab" characters to zsh
} 
} Without special copy&paste support, "pasting" just means the terminal
} emulator types in the text very quickly, and <TAB> means to do
} completion in this case...

If you are using completions from "compinit" you can do this:

    zstyle ':completion::*' insert-tab 'pending=1'

This causes completion to look for pending input when it sees a TAB
character and insert the tab literally if there's more input after it.
Typically this happens only when pasting unless you are working with
a very slow connection or a heavily loaded CPU, so the effect is that
you are able to paste tabs without having completion consume them.

} That said, recent zsh support terminal copy&paste, so with my zsh 5.2
} this works out of the box (setopt zle_bracketed_paste), at least in
} urxvt and xterm.

There's actually no setopt for this, it's on by default.  To turn it
OFF you must do "unset zle_bracketed_paste" (it's a parameter, not an
option).


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: zsh Issue - "Tab" character is not pasted into shell
  2016-09-01 16:37   ` Bart Schaefer
@ 2016-09-02  7:21     ` Xavier Martínez Serrano
  0 siblings, 0 replies; 4+ messages in thread
From: Xavier Martínez Serrano @ 2016-09-02  7:21 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 1633 bytes --]

Since I use "zsh 4.3.17 (x86_64-unknown-linux-gnu)" version the trick
"zstyle ':completion::*' insert-tab 'pending=1'" worked for
me. I will put it in ".zshrc".

I usually deal with tab-delimited tables, and it was really annoying for me
when I wanted to parse some parts using shell commands

Thank you very much!

Xavi


2016-09-01 18:37 GMT+02:00 Bart Schaefer <schaefer@brasslantern.com>:

> On Sep 1,  3:48pm, Christian Neukirchen wrote:
> } Subject: Re: zsh Issue - "Tab" character is not pasted into shell
> }
> } Xavier Martinez Serrano <xmarti6@xtec.cat> writes:
> }
> } > I recently experimented an issue when pasting "tab" characters to zsh
> }
> } Without special copy&paste support, "pasting" just means the terminal
> } emulator types in the text very quickly, and <TAB> means to do
> } completion in this case...
>
> If you are using completions from "compinit" you can do this:
>
>     zstyle ':completion::*' insert-tab 'pending=1'
>
> This causes completion to look for pending input when it sees a TAB
> character and insert the tab literally if there's more input after it.
> Typically this happens only when pasting unless you are working with
> a very slow connection or a heavily loaded CPU, so the effect is that
> you are able to paste tabs without having completion consume them.
>
> } That said, recent zsh support terminal copy&paste, so with my zsh 5.2
> } this works out of the box (setopt zle_bracketed_paste), at least in
> } urxvt and xterm.
>
> There's actually no setopt for this, it's on by default.  To turn it
> OFF you must do "unset zle_bracketed_paste" (it's a parameter, not an
> option).
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-09-02  7:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-01  8:42 zsh Issue - "Tab" character is not pasted into shell Xavier Martínez Serrano
2016-09-01 13:48 ` Christian Neukirchen
2016-09-01 16:37   ` Bart Schaefer
2016-09-02  7:21     ` Xavier Martínez Serrano

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).