shell-pool / shpool

Think tmux, then aim... lower
Apache License 2.0
1.03k stars 13 forks source link

add motd pager mode #8

Closed ethanpailes closed 2 months ago

ethanpailes commented 2 months ago

This is chained on https://github.com/shell-pool/shpool/pull/6, I'll rebase before merging

This patch adds a new pager mode for displaying the
motd. The difference between the normal dump mode
and the pager mode is that the pager will always
display the motd, regardless of if a user is making
a new session or reattaching to an old session.

Rather than using Pager(String) for the enum variant
I decided to go with a slightly more verbose struct
enum variant so that there is room to add more options
to this mode. I'm anticipating that users may want
something like the ability to set a cooldown time
so that this does not trigger on every reattach, but
does trigger on the first reattach done in a day.
For now, I'm not including any such options, but I
want to be able to add them in a backwards compatible
way
ethanpailes commented 2 months ago

I merged the diffbase and pushed, this should be reviewable now @nicolasavru

ethanpailes commented 2 months ago

I need to write a test to make sure the pager display routine exits cleanly if the client hangs up