Quantcast

GNU screen hardstatus line

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

GNU screen hardstatus line

Allan
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.

Thanks

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: GNU screen hardstatus line

Nikolay Aleksandrovich Pavlov
2017-01-25 19:12 GMT+03:00 Allan <[hidden email]>:
> 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.

`ps -p {process id} -o etime` (for the current shell: `ps -p $$ -o
etime`). Universal, works for every app. Though can’t say how this
interacts with hibernation and <C-z> suspends.

May need to check `pstree -p -h` or `ps -t $TTY` to get `{process id}`.

>
> Thanks
>
> --
> --
> 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 [hidden email].
> For more options, visit https://groups.google.com/d/optout.

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: GNU screen hardstatus line

Erik Falor
In reply to this post by Allan
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

signature.asc (169 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: GNU screen hardstatus line

Allan
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Loading...