From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15711 invoked by alias); 20 Mar 2013 18:38:38 -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: 17715 Received: (qmail 22255 invoked from network); 20 Mar 2013 18:38:36 -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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at trustfood.org does not designate permitted sender hosts) Date: Wed, 20 Mar 2013 19:28:27 +0100 From: Eric Smith To: Zsh Users Subject: truncating string in .zprofile Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) I have the following prexec() in my profile; preexec () { print -Pn "\033k\033\134\033k[$1]\033\134" } This prints the command in the screen caption for that window. What I want to do is limit this window title to n chars. However, I cannot manipulate the `$1' in the print string. Even if I try. substring=$1 preexec () { print -Pn "\033k\033\134\033k[$substring]\033\134" } then there is no value printed for $substring. What is the solution? Thank Eric Smith