From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24384 invoked by alias); 10 Nov 2014 11:15:04 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 19357 Received: (qmail 17962 invoked from network); 10 Nov 2014 11:15:02 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 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== X-Received: by 10.194.57.169 with SMTP id j9mr40540381wjq.33.1415617650361; Mon, 10 Nov 2014 03:07:30 -0800 (PST) Message-ID: <1415617649.1260.4.camel@gmail.com> Subject: How to add a 'non-escaped' tilde to the completion list From: Death Jester To: zsh-users@zsh.org Date: Mon, 10 Nov 2014 12:07:29 +0100 Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.7-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit 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