shell-pool / shpool

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

fix motd = "dump" mode #16

Closed ethanpailes closed 1 month ago

ethanpailes commented 1 month ago

The current motd = "dump" mode will mangle the first shell prompt that gets printed. There were two problems, both of which are fixed in this patch.

The first problem, was that we were only matching on the first control code that clear emits. To fix this this patch starts resolving the clear control codes emperically rather than through terminfo queries.

The second problem was that our motd splicing logic was buggy and would cause the next chunk after the motd chunk to include a bunch of trailing zeros.