From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27075 invoked by alias); 24 Aug 2010 15:07:54 -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: 15324 Received: (qmail 24131 invoked from network); 24 Aug 2010 15:07:51 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <100824080744.ZM27926@torch.brasslantern.com> Date: Tue, 24 Aug 2010 08:07:44 -0700 In-reply-to: Comments: In reply to Mikael Magnusson "Crash in reverse-menu-complete with menu-selection" (Aug 24, 3:48pm) References: X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Prompt formatting tricks for cut-and-paste MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Aug 24, 3:48pm, Mikael Magnusson wrote: } } % zsh -f } % autoload compinit } % compinit -D } % zmodload zsh/complist } % bindkey '^F' menu-select } % bindkey '^B' reverse-menu-complete } } (btw, I just realized after a couple of years if you do 'alias %=' in } the zsh -f you can paste things like these more easily). That works if you use an extremely simple prompt that can be aliased. You might want to use alias %=' ' so that the next word (the real command) is also alias-expanded. Not so important when testing with zsh -f ... Another similar trick is to have your more complex prompt begin with ":" and end with ";", so you get things that look like : user@host; bindkey '^F' menu-select : user@host; bindkey '^B' reverse-menu-complete If you combine that with coloring or %B/%b so the prompt stands out, there's little loss of readability. You still have to avoid using glob or redirect characters in the prompt (unless you also throw in quotes, but then you're wasting 5+ characters on the trick). Note you probably want to fix up at least PS2 in a similar way.