Thanks ewfalor and ZyX,
I see what you mean.
ps -ostart_time $(echo $STY | cut -d. -f1) 
will give me the start time and
ps -p $(echo $STY | cut -d. -f1)  -o etime
will give me the elapsed time. 
I finally end up with using the following backtick in my .screenrc:
backtick  0 30 30 sh -c 'ps -o lstart $(echo $STY | cut -d. -f1) '
Thanks
On Wednesday, January 25, 2017 at 11:29:56 AM UTC-5, ewfalor wrote:
> On Wed, Jan 25, 2017 at 08:12:25AM -0800, Allan wrote:
> > Hi
> > 
> > Is there a way to note down the starting time or the duration of the current screen session? I always resume after a long time after and feel it would be helpful to know when the screen session was started.
> 
> This is not really a vim question, but I'll bite.
> 
> Unfortunately, screen's built-in 'time' command gives you the current
> time instead of the duration of the screen session itself.
> 
> Offhand, I'd suggest asking ps(1) for the starting time of your screen
> server. You can get the PID of the screen server from the STY
> environment variable from within screen:
> 
>     ps -ostart_time $(echo $STY | cut -d. -f1) 
> 
> You could put the output of a variation of that command into the
> statusline by means of screen's 'backtick' command.
> 
> For follow-up discussion, I recommend the screen-users mailing list
> 
>     http://lists.gnu.org/archive/html/screen-users
> 
> and/or the #screen channel on Freenode.
> 
> -- 
> Erik Falor
> Registered Linux User #445632                    http://unnovative.net
-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
--- 
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment