peterh / liner

Pure Go line editor with history, inspired by linenoise
MIT License
1.04k stars 132 forks source link

multiline support #59

Closed flisky closed 8 years ago

flisky commented 8 years ago

Fix #55 and influxdb/influxdb#4279

flisky commented 8 years ago

I think it's ready for a review, except a few issues -

  1. the WINCH handling works on UXTerm, but not on gnome-terminal. gnome-terminal seems it automatically refresh the line before we refresh. Can you confirm it?
  2. When ctrlC on linux, we scroll up a line when needed. not figure out a good way to do this.
  3. The multiline mode doesn't work on dumb term, and linenoise doesn't, either. Is it okay to leave the dumb support alone?
flisky commented 8 years ago

ping @peterh

peterh commented 8 years ago

Sorry for the delay.

  1. I can confirm that gnome-terminal is worse than xterm. On both, I can cause problems if I resize the window too quickly, and on both it looks good if I resize the window sufficiently slowly. But it seems "Sufficiently slowly" is much slower for gnome-terminal than it is for xterm.
  2. fmt.Println() always moves the cursor down or scrolls the window up as needed. See review below.
  3. It is okay to leave dumb support alone. (In fact, TERM=dumb is always multi-line as implemented by this patch series. When the related bug report was opened, I thought something else was meant by the term "multi-line").

Review: Looks good overall. Individual patch review:

flisky commented 8 years ago

update:)

peterh commented 8 years ago

Pulled. Thanks!

flisky commented 8 years ago

Thanks for the merging:)