Re: Need a way to switch to a slow new window

David Woodfall <[email protected]>
Newsgroups gmane.comp.gnu.screen.user
Message-ID <20171117013002.GF32077@Blackswan>
>I have a copy mode bind that launches elinks in a new screen window
>after selecting a URL. By default it won't switch to the new window,
>so I tried adding a 'select' command on the end, but I get an error
>back because it seems that select tries to run before the new window
>is created, so I get a message about giving a window number or name.
>
>Here's the bind:
>
>bindkey -m 'E' eval 'stuff \040' 'writebuf' 'exec sh -c "screen elinks `cat /tmp/screen-exchange`"' 'select elinks'
>
>I tried adding an idle command before the select and an 'idle 0' after
>it, but that didn't work.
>
>Any ideas on how to switch to the new window automatically?
>
>Dave

OK I found a method:

bindkey -m 'E' eval 'stuff \040' 'writebuf' 'screen -t elinks sh -c
"elinks `cat /tmp/screen-exchange`"'

Now it switches to the screen window and exits it when elinks exits.
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.