czw., 14 mar 2024, 17:04 użytkownik <screen-users-requ...@gnu.org> napisał:
> Send screen-users mailing list submissions to > screen-users@gnu.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.gnu.org/mailman/listinfo/screen-users > or, via email, send a message with subject or body 'help' to > screen-users-requ...@gnu.org > > You can reach the person managing the list at > screen-users-ow...@gnu.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of screen-users digest..." > > > Today's Topics: > > 1. Re: screen session remember (Neal Fultz) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Thu, 14 Mar 2024 08:50:30 -0700 > From: Neal Fultz <nfu...@gmail.com> > To: aotto <aotto1...@t-online.de> > Cc: Anton Sharonov <anton.sharo...@gmail.com>, screen-users@gnu.org > Subject: Re: screen session remember > Message-ID: > < > cal9b2vfuosbuvens3omvf8nbgvt2uugwe6hmuaypkv1y2r0...@mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Note that $WINDOW is the number when the process is created, vs `screen -Q` > is at runtime - if/when you renumber windows they will no longer match. > Maybe that's a bug you can live with, though. > > On Thu, Mar 14, 2024 at 12:18 AM aotto <aotto1...@t-online.de> wrote: > > > Hi, thanks for this hint, I update your code > > > > # Screen only > > if [ -n "$STY" ] ; then > > source ~/.screendb > > > > SNUM=d$WINDOW > > > > if [ -n "${!SNUM}" ] ; then > > cd "${!SNUM}" > > PROMPT_COMMAND="$PROMPT_COMMAND; sed -i > > 's!$SNUM=.*!$SNUM='\$(pwd)'!' ~/.screendb" > > fi > > fi > > > > the "WINDOW" variable is already do the `screen -Q number` thing and I > use > > the > > external ".screendb" for storage. > > > > > > d0=/home/myusr/prj/tool > > d1=/home/myusr > > d2=/tmp > > d3=. > > d4=. > > d5=. > > d5=. > > d7=. > > d8=. > > d9=. > > > > > > > > On 13.03.24 23:26, Neal Fultz wrote: > > > # Screen only > > > if [ -n "$STY" ] ; then > > > > > > d1=/home/nfultz/projects > > > > > > SNUM=`screen -Q number` > > > SNUM=d${SNUM%% *} > > > > > > if [ -n "${!SNUM}" ] ; then > > > cd "${!SNUM}" > > > PROMPT_COMMAND="$PROMPT_COMMAND; sed -i > > 's!$SNUM=.*!$SNUM='\$(pwd)'!' ~/.bashrc" > > > fi > > > > > > fi > > > > > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > https://lists.gnu.org/archive/html/screen-users/attachments/20240314/0f1a9614/attachment.htm > > > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > screen-users mailing list > screen-users@gnu.org > https://lists.gnu.org/mailman/listinfo/screen-users > > > ------------------------------ > > End of screen-users Digest, Vol 1793, Issue 2 > ********************************************* >