Closed danielmirchandani closed 1 month ago
I think this has to do with $TERM
. I have two SSH connections that end up starting less
. In less
, !echo TERM=$TERM
(run a shell command and show output separately while less
is still running), shows:
shpool
(-t less /any/file
), "TERM=xterm-256color"shpool
(-t shpool attach -f login
), "TERM=dumb"less
appears to use $TERM
to determine terminal capabilities (probably a bug in less
), but where is the value "dumb" coming from?
Looking at the log you attached I see
2024-08-22T15:25:22.181651Z INFO ThreadId(46) handle_conn{cid=6}:handle_attach:spawn_subshell:inject_env: new
2024-08-22T15:25:22.181667Z INFO ThreadId(46) handle_conn{cid=6}:handle_attach:spawn_subshell:inject_env: injecting TERM into shell Some("xterm-256color")
so it seems like shpool should be injecting the right TERM value when it spawns the shell, but I think we don't properly inject the term value into the pager process for displaying the motd. All we do to set up the pager process is this, so hopefully we can fix this bug by threading the same environment we use to setup the shell down to the pager process.
Thanks for trying this feature out an finding this bug!
What happened After tapping my security key, I see "WARNING: terminal is not fully functional" and "Press RETURN to continue". Pressing any key then displays the MotD, but without any terminal colors.
What I expected to happen After tapping my security key, I expect to see the MotD (in color) next.
To Reproduce Steps to reproduce the behavior:
[motd.pager] bin = "less"
(config file does have a new-line, but removed here for formatting)-t shpool attach -f login
Version info shpool 0.6.3 (cl/665149055)
Logs shpool.log