This patch teaches shpool to suppress the prompt prefix setup code so it does not annoyingly flash on the screen. The trick is to have the reader thread drop all data until it has seen a setup sentinel, which we print from a magic invocation of shpool daemon (we use an env var to tell shpool that it is in the magic invocation rather than a flag or a different subcommand since env vars are good for non-user-facing invocations). At first I tried doing echo $SENTINEL, but this runs into trouble because different shells wind up writing it to the raw output stream a different number of times due to different echo behavior.
This means we stop issuing clear codes after the prompt prefix setup code, which prevents old context from getting clobbered. It potentially means we could get rid of motd = "dump" mode all together since the lack of clear now means that we could just rely on sshd for those cases. I need to think about this some more.
This patch teaches shpool to suppress the prompt prefix setup code so it does not annoyingly flash on the screen. The trick is to have the reader thread drop all data until it has seen a setup sentinel, which we print from a magic invocation of
shpool daemon
(we use an env var to tell shpool that it is in the magic invocation rather than a flag or a different subcommand since env vars are good for non-user-facing invocations). At first I tried doingecho $SENTINEL
, but this runs into trouble because different shells wind up writing it to the raw output stream a different number of times due to different echo behavior.This means we stop issuing clear codes after the prompt prefix setup code, which prevents old context from getting clobbered. It potentially means we could get rid of
motd = "dump"
mode all together since the lack ofclear
now means that we could just rely on sshd for those cases. I need to think about this some more.