dream
dream copied to clipboard
Does Dream.run clobber terminal line wrapping setting, and depend on TERM=xterm-256color?
Dream.run, if not called with adjust_terminal:false, sets some terminal settings, and then tries to restore them on exit (code below).
- [ ] We have switched to Ctrl+C for exit. Are the settings being restored during exit by Ctrl+C? This can be checked by inserting a
print_endlineinto therestore_terminalfunction, and just making sure the print occurs. - [ ] @thangngoc89 reported Dream messing with the terminal somehow inside tmux, where
TERMwasn't originallyxterm-256color. Is the way Dream is changing the settings portable across terminal emulation modes?
In the future, either the log will be terminal width-aware, or we will probably just use dumb line wrapping, and always behave as if adjust_terminal:false at the Dream.run level.
https://github.com/aantron/dream/blob/b8a46f4649d9ca296d89b49acd55aed8a7e29a41/src/http/http.ml#L818-L838
restore_terminal was not being called on Ctrl+C, but it does with this PR.
I think the first part of this issue was fixed in #151. I'm not observing any issues with tmux at the moment.