Re: Get current working directory from another screen window

Jostein Berntsen <jbernts-gyXR7Lt7FVk/[email protected]>
Newsgroups gmane.comp.gnu.screen.user
Message-ID <20110623220500.GA23613@josteinb>
On 23.06.11,14:25, Sadrul Habib Chowdhury wrote:
> On Wed, Jun 22, 2011 at 10:38 AM, Tomasz Muras <[email protected]> wrote:
> > Hello,
> >
> > I'm wondering if something like this would be possible:
> > I would like to quickly switch to the same current working directory
> > as in another screen window. Would it be possible to read cwd of
> > another window?
> 
> The windows in screen are unaware of each other. So what you want to
> do cannot be done through screen [easily].
> 

If you know the specific windows numbers and have xclip available, you 
can use something like this command:

eval "at '4' stuff 'echo `pwd` | xclip -sel clip\n'" eval "at '2' \ 
stuff 'cd `xclip -sel clip -o`\n'"

Windows 2 will then cd to the same directory as in window 4.


Jostein
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.