[Discuss] Locating specific terminal windows by pty number?

John Abreau abreauj at gmail.com
Mon Jan 8 18:37:29 EST 2024


I usuallyto have many terminal windows open at a time, with most windows
having multiple tabs.

Every once in a while I go to edit a file in nvi, only to discover it's
already locked by another instance of nvi.

I can find the other instance with "ps x | grep [n]vi", and find its pty id
(pty/34), but it would take an inordinate amount of time to dig through all
the open terminals and tabs to locate it.

Given the pty number and/or the process id, is there a way to quickly
locate the offending window and raise it to the foreground? Preferably from
the command line?



(I use nvi, rather than vim,because I learned vi back in 1983 on a BSD
machine, and nvi is a fork of the original vi code from BSD, so it's
compatible with a lifetime of muscle memory, whereas vim is both lacking in
obscure vi features that I use often, and contains unexpected features that
I occasionally trip over and don't know how to back out of)

-- 
John Abreau / Executive Director, Boston Linux & Unix
Email: abreauj at gmail.com / WWW http://www.abreau.net / PGP-Key-ID 0x920063C6
PGP-Key-Fingerprint A5AD 6BE1 FEFE 8E4F 5C23  C2D0 E885 E17C 9200 63C6


More information about the Discuss mailing list