From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19654 invoked by alias); 6 Jan 2018 22:03:36 -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: 23053 Received: (qmail 7044 invoked by uid 1010); 6 Jan 2018 22:03:36 -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 1.924785 secs); 06 Jan 2018 22:03:36 -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=vS-bSvcOT_qYJg2bczUA:9 a=QEXdDO2ut3YA:10 X-EL-IP-NOAUTH: 24.207.101.9 To: Zsh Users From: Ray Andrews Subject: command on switching terminals? Message-id: <5dbdfef3-65c0-b780-76a8-86ed79c0d8e4@eastlink.ca> Date: Fri, 05 Jan 2018 21:33:17 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 Content-language: en-CA Is it possible for zsh to know when the terminal in which it is running has awakened by having the mouse moved into that window?  I understand that it's the window manager that decides which terminal is active of course, but perhaps zsh knows when it is put to sleep by the mouse moving out of it's window, and also knows when it has been awakened again? I have a utility that lets you hotkey a mouse jump between terminals so as to jump between them without having to reach for the mouse itself, and I can call it fine within a function, but I'd like to be able to also execute some code after each jump but in the new window.  As it is, zsh just wakes up without seeming to know it's been asleep so there's nothing to 'attach' any commands to.  precmd() and preexec() are not aroused.   Any commands inside the calling function placed after the command to jump to the new terminal are executed in the old terminal, which is not surprising, so it would have to depend on the awakened terminal knowing it's been awakened.  Sorta like precmd but hooked to the activation of the terminal.  I understand that this might be outside of zsh's domain.