zsh-users
 help / color / mirror / code / Atom feed
* How to add a 'non-escaped' tilde to the completion list
@ 2014-11-10 11:07 Death Jester
  2014-11-10 11:31 ` Peter Stephenson
  0 siblings, 1 reply; 11+ messages in thread
From: Death Jester @ 2014-11-10 11:07 UTC (permalink / raw)
  To: zsh-users

Hi *,
I have the following completion function:

  function _term_list(){
    local -a w

    for SESSION in $(pidof  zsh); do
      PA=$(readlink -n /proc/${SESSION}/cwd)
      case ${PA} in
        ${HOME}*) w+=$(echo ${PA} | sed s"|${HOME}|~|") ;;
        *) w+=${PA} ;;
      esac
    done

    compadd -a w
  }

  zle -C term_list complete-word _generic
  bindkey "^v" term_list
  zstyle ':completion:term_list:*' completer _term_list

It provides a list of paths in which other zsh sessions are in. I want
to substitute my home folder with a tilde (~). But unfortunately the
line '${HOME}*) w+=$(echo ${PA} | sed s"|${HOME}|~|") ;;' does not work
as intended. The tilde is always "escaped". So the output looks like:
  \~
  \~/folder

How can I remove the backslash.

Thank you in advance.

Cheers,
Jester




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

end of thread, other threads:[~2014-11-11 21:41 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-10 11:07 How to add a 'non-escaped' tilde to the completion list Death Jester
2014-11-10 11:31 ` Peter Stephenson
2014-11-10 12:18   ` Peter Stephenson
2014-11-10 13:21     ` Death Jester
2014-11-10 13:42       ` Peter Stephenson
2014-11-10 13:57       ` Oliver Kiddle
2014-11-10 15:32         ` Death Jester
2014-11-10 21:03           ` Oliver Kiddle
2014-11-11 10:17             ` Death Jester
2014-11-11 21:40             ` Jan Larres
2014-11-10 12:54   ` Death Jester

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).