Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support multiline tea.Println() messages
Normally, consumers are required to make their UI aware of the terminal size, and printed output is truncated to the size of the terminal. This is so the cursor will always end up in a predicatable vertical position for rendering. However, when printing messages from tea.Println() scrollback mode, there are a number of reasons to allow lines to wrap: - tea.Println() messages are not part of the re-drawn UI, so their wrapping does not affect our measurement of the UI height. This is what _would_ be messed if ui messages were to wrap in the terminal. - tea.Println() messages are usually used for status updates, and truncating those messages makes them no longer useful. In order to avoid truncation, the consumer may manually wrap lines, however: - Since messages are printed and never re-rendered, resizing the terminal in the future will not re-wrap the lines to the new terminal width - Terminal emulators will not recognize clickable text (filepaths, urls) that have been manually wrapped across multiple lines, as the `\r\n` in the middle of the text will break most terminal emulators' recognition
- Loading branch information