shell-pool / shpool

Think tmux, then aim... lower

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Investigate ways to suppress prompt_prefix setup code

ethanpailes opened this issue · comments

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

+1 -- this is a bit unnerving

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.