0

I'm getting a weird and very annoying behavior in my terminal. When I type a protocol (i.e 'http:') then the pipe (|) character a backslash() is automatically inserted before the pipe character.

My test:
 type 'htt'+'|'             => 'ht|'
 type 'htt:'+'|'            => 'htt:|'
 type 'http'+'|'            => 'http|'
 type 'http:'+'|'           => 'http:\|'
 type 'http://foo.com'+'|'  => 'http://foo.com\|'
 type 'curl http://foo.com'+'|'  => 'curl http://foo.com\|'
 type 'curl https://foo.com'+'|'  => 'curl http://foo.com\|'

The same thing happens when I use 'ftp:' but not when I use 'telnet:'

Does anybody know what could be doing this?

This is my system: OSX sierra iTerm2 3.0.12 zsh 5.2 (x86_64-apple-darwin16.1.0) pretzo (https://github.com/sorin-ionescu/prezto)

Khai Do
  • 68
  • 4
  • Does the same thing happened with characters like `&`? It sounds like `prezto` enabled a ZLE widget that automatically escapes shell metacharacters if it looks like you are typing them as part of a URL. (I don't recall if this is a built-in feature that can be enabled, or if it is a custom widget it installs.) – chepner Sep 09 '17 at 15:10
  • (IIRC, a `telnet:` URL would never contain a `|`, since it can't contain an arbitrary "path" like `http` or `ftp`.) – chepner Sep 09 '17 at 15:11
  • Ahh yes, a bunch of other characters do the same thing, #, &, ), }, ?, etc.. – Khai Do Sep 11 '17 at 05:19
  • Do you know how to stop it from happening? I've done a quick search on ZLE widget but still can't figure out how to make it stop. – Khai Do Sep 11 '17 at 05:37
  • See https://stackoverflow.com/questions/25614613/how-to-disable-zsh-substitution-autocomplete-with-url-and-backslashes#25622864, which might be helpful. – chepner Sep 12 '17 at 14:53

0 Answers0