* zsh Issue - "!~ " character is not pasted into shell, insted I get "~/.ssh/config"
@ 2016-09-21 14:27 Xavier Martínez Serrano
2016-09-21 17:36 ` Bart Schaefer
0 siblings, 1 reply; 2+ messages in thread
From: Xavier Martínez Serrano @ 2016-09-21 14:27 UTC (permalink / raw)
To: zsh-workers
[-- Attachment #1: Type: text/plain, Size: 530 bytes --]
Hi all,
I'm using zsh 4.3.17 (x86_64-unknown-linux-gnu)" version
and when I was developing some small awk codes, I tried to paste
them to the terminal, but when I used the operator "!~ " I realised
that, when pasting, zsh translated it to "~/.ssh/config". Quite annoying
thing though don't know if may be is resolved in newer zhs versions.
This is the output of pasting "!~" many times:
!~!~!~
This is the output of pasting "!~ " (note the last space) many times:
~/.ssh/config ~/.ssh/config ~/.ssh/config
Many thanks,
Xavi
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: zsh Issue - "!~ " character is not pasted into shell, insted I get "~/.ssh/config"
2016-09-21 14:27 zsh Issue - "!~ " character is not pasted into shell, insted I get "~/.ssh/config" Xavier Martínez Serrano
@ 2016-09-21 17:36 ` Bart Schaefer
0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2016-09-21 17:36 UTC (permalink / raw)
To: Xavier Martinez Serrano, zsh-workers
On Sep 21, 4:27pm, Xavier Martinez Serrano wrote:
}
} I'm using zsh 4.3.17 (x86_64-unknown-linux-gnu)" version
} and when I was developing some small awk codes, I tried to paste
} them to the terminal, but when I used the operator "!~ " I realised
} that, when pasting, zsh translated it to "~/.ssh/config". Quite annoying
"!" is the history reference character, so !~ means to search for a
history event beginning with a tilde and substitute that event into
the command at that position.
Apparently somewhere in your command history you typed ~/.ssh/config
at the beginning of a line, and now !~ is finding that as the history
event to substitute.
You can "setopt NO_BANG_HIST" to disable this, or you can use single
quotes '!~' to prevent the expansion (double quotes permit it).
It's additinally possible that your /etc/z* files or some other init
file have attached the magic-space widget to the space character.
This causes !-history references to IMMEDIATELY expand when followed
by a space, even a space originating from copy-paste (at your version
number; behavior of paste has changed in very recent zsh).
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-09-21 17:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-21 14:27 zsh Issue - "!~ " character is not pasted into shell, insted I get "~/.ssh/config" Xavier Martínez Serrano
2016-09-21 17:36 ` Bart Schaefer
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).