From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22053 invoked by alias); 7 Jan 2018 16:45:19 -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: List-Unsubscribe: X-Seq: 23061 Received: (qmail 24029 invoked by uid 1010); 7 Jan 2018 16:45:19 -0000 X-Qmail-Scanner-Diagnostics: from mta02.eastlink.ca by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(24.224.136.13):SA:0(-2.6/5.0):. Processed in 3.490526 secs); 07 Jan 2018 16:45:19 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: rayandrews@eastlink.ca X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | MIME-version: 1.0 Content-transfer-encoding: 8BIT Content-type: text/plain; charset=utf-8; format=flowed X-Authority-Analysis: v=2.3 cv=OKgJIxSB c=1 sm=1 tr=0 a=RnRVsdTsRxS/hkU0yKjOWA==:117 a=RnRVsdTsRxS/hkU0yKjOWA==:17 a=IkcTkHD0fZMA:10 a=iCdwLDQcdU0O6bbn6aQA:9 a=QEXdDO2ut3YA:10 X-EL-IP-NOAUTH: 24.207.101.9 Subject: Re: command on switching terminals? To: zsh-users@zsh.org References: <5dbdfef3-65c0-b780-76a8-86ed79c0d8e4@eastlink.ca> <2d7330aa-e5c6-e6be-f432-60dd5a6489e4@eastlink.ca> From: Ray Andrews Message-id: <1ea12fc3-c90f-103d-88ca-1c1bc80b503d@eastlink.ca> Date: Sun, 07 Jan 2018 08:45:12 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 In-reply-to: Content-language: en-CA On 07/01/18 05:24 AM, Mikael Magnusson wrote: I can't get it to work Mikael, here's my current hacked up test code, I source it in two different terminals and then change focus between them but nothing seems different.  I've tried a few variations on this with no luck: ------------------------------ #!/usr/bin/zsh function _zle_line_init() {   [[ $TERM = xterm ]] && printf '\e[?1004h' echo in-$TERM } function _zle_line_finish() {   [[ $TERM = xterm ]] && printf '\e[?1004l' echo out-$TERM } zle -N zle-line-init _zle_line_init zle -N zle-line-finish _zle_line_finish # The test echo's in the functions show that the above two lines are in effect, I get: #    $ in-xterm #    out-xterm # ... after every ENTER. bindkey '^[[I' focus-in bindkey '^[[O' focus-out zle -N focus-in _focus_handler zle -N focus-out _focus_handler # But this seems not to be called: function _focus_handler() {   if [[ $WIDGET = focus-in ]]; then     zle -M "hey we got focus"   fi   if [[ $WIDGET = focus-out ]]; then     zle -M "we lost focus"   fi echo _focus_handler where are you? } echo sourced ok