shell-pool / shpool

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

Investigate ways to suppress prompt_prefix setup code #19

Closed ethanpailes closed 4 weeks ago

ethanpailes commented 1 month ago

The current situation where we inject the prompt_prefix setup code is not ideal since it flashes on the screen for a little bit before the clear command makes it go away and gives users a fresh terminal. Ideally we would prevent the user from seeing it at all.

One thing to try would be disabling local echo, though I'm worried there would still be weirdness from the shell re-printing the prompt a bunch of times. We could also try echoing some sentinel value like echo SHPOOL__PROMPT_PREFIX_SENTINAL__ and then scanning for this sentinel with a handy dandy trie so we can drop everything before the sentinel on the floor to avoid showing users (really it will be everything before the second instance of the sentinal).

ameyalaad commented 1 month ago

+1 -- this is a bit unnerving

ethanpailes commented 1 month ago

I think I have a solution that will work for this. https://github.com/shell-pool/shpool/tree/suppress_prompt_prefix_setup_code contains the code. It could mean we can do away with motd = "dump" mode all together because it means we no longer issue clears after the prompt setup code.

Not a PR yet because I still need to debug tests and write some new ones.