dream icon indicating copy to clipboard operation
dream copied to clipboard

Does Dream.run clobber terminal line wrapping setting, and depend on TERM=xterm-256color?

Open aantron opened this issue 4 years ago • 1 comments

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_endline into the restore_terminal function, and just making sure the print occurs.
  • [ ] @thangngoc89 reported Dream messing with the terminal somehow inside tmux, where TERM wasn't originally xterm-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

aantron avatar Jul 03 '21 02:07 aantron

restore_terminal was not being called on Ctrl+C, but it does with this PR.

outkine avatar Aug 03 '21 01:08 outkine

I think the first part of this issue was fixed in #151. I'm not observing any issues with tmux at the moment.

aantron avatar Apr 27 '23 12:04 aantron