From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9631 invoked by alias); 6 Jun 2012 18:52:18 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 30498 Received: (qmail 24943 invoked from network); 6 Jun 2012 18:52:07 -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.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.213.43 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:disposition-notification-to:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=JVfVG3+C1+2NTOzRc962S+YP4ZQ2iItqUDap2hQA+xg=; b=CwPH22tdzHOX4pScyAhbhEEgWIF6aJbpQxbWI5Muz8t9dQAgpHL9nowwUKz0CIRF6p ugmDQ6nHjvSG7M7dS+KDP4j+raUjyUURre0NGoO5dGjT/++RNizVcjmwD9Q/TUcU1bjR a6dcL26y2LgOhosDyeJhPOa8k+FZGwPQpMseT1puUd0gtAf4VxzrGOFavs4u2BalRNc5 jCNpd2Qo3SW0bgC+/U+Y5frSOkqGN2FYg+3I1ZT08TKCe3og4ETlqo+6f87P2E/DjMcs DjFa6B57Jhp0MqP4tAj4C69SwfoL7ia6U9+sWuV9xATAnvr4v30xtgA4vGgGa+liKchb MAtA== Message-ID: <4FCFA55E.4090606@gmail.com> Date: Wed, 06 Jun 2012 13:45:50 -0500 From: Edgar Merino User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: Bart Schaefer CC: "zsh-workers@zsh.org" Subject: Re: Keybindings lost in Xterm after top exits References: <4FC5B2CB.6090701@gmail.com> <120530075824.ZM6547@torch.brasslantern.com> In-Reply-To: <120530075824.ZM6547@torch.brasslantern.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Thank you very much for your solution and in depth explanation of the problem, I had no idea how to resolve this. I did the tests you mentioned and indeed top was enabling both application cursor keys and application keybad. I would like to wrap top within a function, however I don't know how to set the mode back to normal mode from a script, can you point me to any source where I could investigate on how to this? Thanks in advance! On 30/05/12 09:58, Bart Schaefer wrote: > On May 30, 12:40am, Edgar Merino wrote: > } > } I mean, I've got keybindings to fix my home/end keys, also to use > } up-line-or-search/down-line-or-search with up/bottom keys, these > } keybindings are lost when I exit the "top" command line utility, and > } this happens only when using xterm. > > This probably means that top is switching the "keypad transmit mode" > setting of the terminal and then leaving it in a different state than > when it began. This could either be because of a bug (top sets the > state to X at startup and never restores it) or because your terminal > starts out in state X but top resets it to Y at exit anyway. > > The manual page for xterm may refer to keypad transmit mode as "the > application keypad mode". Try this: > > Use ctrl-middle-button to bring up the "VT options" menu and examine > the state of the checkmarks for "enable application cursor keys" and > "enable application keypad". > > Run top and exit, then look at the state of the menu again. If those > checkmarks have changed, that's your problem. > > You have a couple of choices here: > > Use that menu to reset the terminal every time you run top; or > > Make sure your keybindings are set the same way for both "normal mode" > and "keypad transmit mode" so zsh doesn't care what top does; or > > Create a wrapper function for top that explicitly sets the mode to > the one your bindings expect, after top finishes.