Some terminal applications, like mutt and weechat, prints a newline at
the end of each line even if text is wrapped. This causes urls which are
wrapped to not be selectable in full.
By ignoring newlines when the text fills the entire width of the screen,
those urls can be selected. Many other terminal emulators do this as
well.
A drawback of this is that if a url happens to fill the width of the
screen, the url selection will include the first word of the next line,
but this doesn't happen that often so I think it's an okay tradeoff.
Fixes#313
Remove tests that asserted that Cursor Down (CUD) and Cursor Up (CUU)
escape sequences were affected by the scrolling region set by DECSTBM.
This was incorrect and recently fixed:
https://github.com/termux/termux-app/issues/1340
Termux will now properly send \r to the terminal instead of \n when pasting
multiline strings.
This fixes cat not repeating back lines and nano accidentally justifying
text (because \n maps to ^J), as well as other potential issues.
This matches the behavior of other terminals, such as iTerm2 which explicitly
does it here:
https://github.com/gnachman/iTerm2/blob/f8a5930/sources/iTermPasteHelper.m#L113
Signed-off-by: easyaspi314 (Devin) <easyaspi314@users.noreply.github.com>
SGR attributes are stored in three variables: mEffect, mForeColor, and
mBackColor. Saving/restoring the cursor only preserves mEffect.
Change the cursor save/restore methods to additionally preserve
mForeColor and mBackColor. This affects both 'explit' saving/restoring
the cursor and switching to/from the alternate screen buffer.
When the number of parameters in a CSI control code exceeds the size of
the mArgs array, the code may attempt to read past the end of the array,
resulting in a force close of the app.
Stop the index from moving past the last element of the mArgs array.