Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: command on switching terminals?
- X-seq: zsh-users 23064
- From: Grant Taylor <gtaylor@xxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: command on switching terminals?
- Date: Sun, 7 Jan 2018 11:48:19 -0700
- Arc-authentication-results: i=1; tncsrv06.tnetconsulting.net; none
- Arc-filter: OpenARC Filter v0.1.0 tncsrv06.tnetconsulting.net w07Ilpk8003257
- Arc-message-signature: i=1; a=rsa-sha256; d=tnetconsulting.net; s=2015; t=1515350872; c=relaxed/simple; bh=PR5WkEnFsU+/jwInJ/ZjcrI9rrCax7XN6AL0jQSaA68=; h=DKIM-Signature:Subject:To:From:Message-ID:Date:User-Agent: MIME-Version:Content-Type; b=eVD969RjcDyNbM4/2eVRvJvW3y+Q2JHXZGTGD3J9+r+ANL4ZgQ7pux3RYnrajNqjQDvslfsAO3zW/xyNGqfjaWYF7s27XJA3DmNhF3eHKu5ZCZqHlQ6piLhrdnLB3HJNdJwkCtO7PiPdHdhdp/MjXXzFNNi9hdVO6xcV3aNQCSY=
- Arc-seal: i=1; a=rsa-sha256; d=tnetconsulting.net; s=2015; t=1515350872; cv=none; b=YjV69o5ojz7a0bB2+f20bXp3VT+nTtW1h5KYPsX+o6ZNm+vNqtT5BmPJ07IPaDsskNb28t7e+JG7YYvtQk+NVfaQEApKyf2Or7FUXfhd4QNuT3rDsOCbm6MEmwTorZugSoy/Rnh8Se4owl+pXQH8g9JoQMIejH9D7ds/D0c/npM=
- Authentication-results: tncsrv06.tnetconsulting.net; arc=none header.d=tnetconsulting.net
- Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=tnetconsulting.net; s=2015; t=1515350872; bh=PR5WkEnFsU+/jwInJ/ZjcrI9rrCax7XN6AL0jQSaA68=; h=Subject:To:References:From:Message-ID:Date:User-Agent: MIME-Version:In-Reply-To:Content-Type:Cc:Content-Disposition: Content-Language:Content-Transfer-Encoding:Content-Type:Date:From: In-Reply-To:Message-ID:MIME-Version:References:Reply-To: Resent-Date:Resent-From:Resent-To:Resent-Cc:Sender:Subject:To: User-Agent; b=KYP2H8rWYLhKvganaPdZmfvO54ab+vtg2LpZ2fi+wckyUXUIiuSRx6dFvksZ0KHSQ LgouWUZ+mW4DMLyEuZBfEcGiUIYG0x9SLOXXbSdI4hqfHws7/Z98/PHLe8TINl853V GpcxTmaGP5/kvGKh/4q1iE0WkowoX09N2Vds4vQg=
- In-reply-to: <68a756b1-db15-8ec4-cdd9-c07a4f9f869e@eastlink.ca>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Organization: TNet Consulting
- References: <5dbdfef3-65c0-b780-76a8-86ed79c0d8e4@eastlink.ca> <CAHYJk3S=p9xtwZKDj-rD+UPCb4TdWN0dSCiqoqYdO0tExuCRog@mail.gmail.com> <68a756b1-db15-8ec4-cdd9-c07a4f9f869e@eastlink.ca>
On 01/06/2018 03:45 PM, Ray Andrews wrote:
What I want to do is pretty esoteric, if I execute my command " c 12 " I
want focus to jump to xterm #12 (which already works fine) but also 'cd'
xterm #12 to the current directory in the xterm I just jumped from.
I'd like to know more about how you're changing the focus of the
windows. Would you please share?
Of course any sort of 'cd' command in the same function but after the
jump continues to be executed in the original xterm, thus I'll want
some way of detecting the change in focus. It's smartassy but should be
educational to fool around with.
I've done something (I think is) similar to what you're wanting to do
via xdotool sending key strokes to other windows.
Window 1 had a proprietary Python program running with a readline macro
defined do perform some actions.
Window 2 had a "while :; do xdotool <send macro initiation key sequence
to window 1>; sleep 60; done" loop running.
Window 3 had a "sleep 72000; xdotool <send Ctrl-C to window 2>" running.
I know that it's not the most graceful, but it did what I wanted it to do.
The point being that I was able to use the xdotool to send keyboard
commands from one window into a different window. - Which sounds
adjacent to what you're wanting your source xterm to do to xterm #12.
Granted, I don't know how to set up the targeting of xdotool in your
scenario. (I used xwininfo to get the Window IDs of window #1 & #2 and
manually put the values on the xdotool command lines in windows #2 & #3
respectively.) But I suspect that can be worked out.
--
Grant. . . .
unix || die
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature
Messages sorted by:
Reverse Date,
Date,
Thread,
Author