gbmhunter / NinjaTerm

A serial port terminal that's got your back.
https://ninjaterm.mbedded.ninja/
GNU General Public License v3.0
74 stars 7 forks source link

Add option to set "infinite" line length, which will let long lines either wrap or add horizontal scroll bars. #306

Open gbmhunter opened 8 months ago

gbmhunter commented 8 months ago

Use case in when a user is pumping lots of data without new line chars, e.g. 2,345,56,45,1,2,3,.... Forcing new line chars in breaks the formatting if they then want to copy/paste this data into another program.

gbmhunter commented 8 months ago

Having lines wrap will cause problems with react-window, which at the moment uses a known fixed height per "row" in the array of terminal data to work out what rows to render. react-window does support variable height rows, but I'm unsure at the moment if that will be enough to make this work.

Variable height demo of react-window at https://react-window.vercel.app/#/examples/list/variable-size

If we could determine the height of each row based on the width of the terminal and the amount of text in it, this might work. Could be hard to calculate the height correctly without actually rendering into the terminal to measure the height.