From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29477 invoked by alias); 25 Oct 2013 15:51:06 -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: 18058 Received: (qmail 4680 invoked from network); 25 Oct 2013 15:51:01 -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.6 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=uwrqNNK/Frf6aapiM/P+hkqGcDMn7glMxvh3jRgHTk4=; b=hfgHz4BlTLLM0sFII/7vrZIEDNcCC88MjrGkym2l9J2wg8UqbapQrMyUy0FF4OC3DL MSfgNPZdI4WQgrCpHXifV+5UDzbXAUJOAxTUw9Qq+se1cPBWMZA4BUHU9pNeJoCQ881H rNYmSZRSsWEH/O8NIzdBfzVl7ANtIizvYoDFEI75Vdf4Z6nSm2mFSBH5UJd68FNVj97N DF7sqyibZIKeVlr9LRm/tdc6HpzNr9vfQU/GTK7W2xdS/tPQg0HW13ZPhj/+Apag/LsH ONuaoDAlLXoCVCekcNscvFK7cK7mESX2jSCW3PDyTdfOcAtImBO7Bp1zMYKtfF7YcLDk PDxQ== X-Gm-Message-State: ALoCoQmHhrzOatHXae1tt00+hKgc6+njpm1DHTbXCaUEKpunYRTMVjfySSb1xz238EG6CbfNMZfQ MIME-Version: 1.0 X-Received: by 10.43.103.133 with SMTP id di5mr1950309icc.38.1382716256301; Fri, 25 Oct 2013 08:50:56 -0700 (PDT) In-Reply-To: <131023064759.ZM9762@torch.brasslantern.com> References: <131023064759.ZM9762@torch.brasslantern.com> Date: Fri, 25 Oct 2013 10:50:56 -0500 Message-ID: Subject: Re: Duplicating TRANSIENT_RPROMPT for left PROPMT? From: Jesse Hathaway To: Bart Schaefer Cc: ZSH Users Mailing List Content-Type: multipart/alternative; boundary=bcaec5171c59484e8e04e992b7b5 --bcaec5171c59484e8e04e992b7b5 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Oct 23, 2013 at 8:47 AM, Bart Schaefer wrote: > On Oct 22, 4:22pm, Jesse Hathaway wrote: > } > } The unusual part of my prompt is the vi mode at the bottom of my screen. > } Does anyone have thoughts on the best way to clear the prompt before the > } command is entered? > > The best solution to this is to NOT put the vi mode in the prompt, but > instead use "zle -M" to display it. Simplest way is like this: > > PS1='%~ ' > vim_ins_mode="-- INSERT --" > vim_cmd_mode="" > > function zle-keymap-select { > > vim_mode="${${KEYMAP/vicmd/${vim_cmd_mode}}/(main|viins)/${vim_ins_mode}}" > zle -M -- "$vim_mode" > } > zle -N zle-keymap-select > zle -N zle-line-init zle-keymap-select > Thanks for your suggestions Bart I tried the zle -M approach, but it seemed to result in my cursor sometimes being at the bottom of the output, and them sometimes the vim_mode prompt appearing, i.e. my cursor was jumping up and down. I ended up adding a preexec which solves the problem: # Clear vim_mode prompt before executing command, as the command output will be # written to same line as the vim_mode prompt on the terminal function preexec { echo -n "$terminfo[el]" } > This and your original scheme both seem to suffer from the problem that > any completion listing covers up the "mode message" and it doesn't return > until you toggle through command/insert again. Yeah this is definitively not great, I spent some time trying to determine how to solve the problem, but I haven't come up with anything yet. I would love suggestions. I couldn't find any hooks to use when suggestions fire. I am also considering diving into the zsh source and look into adding proper support for a BOTTOM_PROMPT. Thanks, Jesse --bcaec5171c59484e8e04e992b7b5--