Commit 5b5e719
Fixed: Improve handling of empty ';' SGR sequences
Currently the Termux terminal emulator prints "HI" in red with:
```sh
printf "\e[31;m HI \e[0m"
```
This is not how other terminals (tested on xterm, gnome-terminal,
alacritty and the mac built in terminal) handle it, since they parse
""\e[31;m" as "\e[31;0m", where the "0" resets the colors.
This change aligns with other terminals, as well as improves performance
by avoiding allocating a new int[] array for each byte processed by
`parseArg()`, and most importantly simplifies things by removing the
`mIsCSIStart` and `mLastCSIArg` state, preparing for supporting ':'
separated sub parameters such as used in
https://sw.kovidgoyal.net/kitty/underlines/1 parent f3e7388 commit 5b5e719
File tree
2 files changed
+53
-47
lines changed- terminal-emulator/src
- main/java/com/termux/terminal
- test/java/com/termux/terminal
2 files changed
+53
-47
lines changedLines changed: 27 additions & 46 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | 129 | | |
135 | 130 | | |
136 | 131 | | |
| |||
1390 | 1385 | | |
1391 | 1386 | | |
1392 | 1387 | | |
1393 | | - | |
1394 | | - | |
1395 | 1388 | | |
1396 | 1389 | | |
1397 | 1390 | | |
| |||
1762 | 1755 | | |
1763 | 1756 | | |
1764 | 1757 | | |
1765 | | - | |
| 1758 | + | |
1766 | 1759 | | |
1767 | 1760 | | |
1768 | 1761 | | |
| |||
1820 | 1813 | | |
1821 | 1814 | | |
1822 | 1815 | | |
1823 | | - | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
1824 | 1820 | | |
1825 | 1821 | | |
1826 | 1822 | | |
| |||
1834 | 1830 | | |
1835 | 1831 | | |
1836 | 1832 | | |
1837 | | - | |
| 1833 | + | |
1838 | 1834 | | |
1839 | 1835 | | |
1840 | 1836 | | |
| |||
2113 | 2109 | | |
2114 | 2110 | | |
2115 | 2111 | | |
2116 | | - | |
2117 | | - | |
2118 | | - | |
2119 | | - | |
2120 | | - | |
2121 | | - | |
2122 | | - | |
2123 | | - | |
2124 | | - | |
2125 | | - | |
2126 | | - | |
2127 | | - | |
2128 | | - | |
2129 | | - | |
2130 | | - | |
2131 | | - | |
2132 | | - | |
2133 | | - | |
2134 | | - | |
2135 | | - | |
2136 | | - | |
2137 | | - | |
2138 | | - | |
2139 | | - | |
2140 | | - | |
2141 | | - | |
2142 | | - | |
2143 | | - | |
2144 | | - | |
2145 | | - | |
2146 | | - | |
2147 | | - | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
2148 | 2122 | | |
2149 | | - | |
2150 | | - | |
2151 | | - | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
2152 | 2131 | | |
2153 | | - | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
2154 | 2135 | | |
2155 | 2136 | | |
2156 | 2137 | | |
| |||
Lines changed: 26 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
166 | 173 | | |
167 | 174 | | |
168 | 175 | | |
| |||
178 | 185 | | |
179 | 186 | | |
180 | 187 | | |
181 | | - | |
| 188 | + | |
182 | 189 | | |
183 | 190 | | |
184 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
185 | 200 | | |
186 | 201 | | |
187 | 202 | | |
| |||
205 | 220 | | |
206 | 221 | | |
207 | 222 | | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
208 | 233 | | |
209 | 234 | | |
210 | 235 | | |
| |||
0 commit comments