Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
How to add a 'non-escaped' tilde to the completion list
- X-seq: zsh-users 19357
- From: Death Jester <d3ath.jest3r@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: How to add a 'non-escaped' tilde to the completion list
- Date: Mon, 10 Nov 2014 12:07:29 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=gmail.com; s=20120113;        h=message-id:subject:from:to:date:content-type:mime-version         :content-transfer-encoding;        bh=zTmfIRo3Wr3b/cCXG0GWYq8bIZMNfqO1JrR9VdIR3vU=;        b=YTFzczPMy+VcoIeCw7w/JVd+HflRfnJo9h8lbCvHJ8DuLtmpUobNEr9J2uGGpqDy0e         QJnD31V1RamzmhiA4ia5ehsdqy8daCKtHquu5VsxTAAtepwbifxnEM3udoXaeyUZ44+b         IprCoOzmseCvYvNRMod11lQy81HYl6VcdJS++UXYkYNMkokJkMxNESo1Oqjn7CnqyDZ/         cJJuyJdrJuPikwvDq5eWghIIlNnC/8zbFEkKKWHJ1ys7DaDOh3OtePfKFppOl1xm84Gj         w0IihHOx3gbNCMP2g1HhYGHzQIDJKIU9R7wlhV7s/3C2i0gP0D00mNeRg36+RmE/DRIa         ARiA==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author