* SGR 4 subparams: * 4:0 - equal to SGR 24 (turn off all underline) * 4:1 - equal to SGR 4 (single underline) * 4:2 - equal to SGR 21 (double underline) * 4:3 - curly underline * 4:4 - dotted underline * 4:5 - dashed underline
(style: number, attr: IAttributeData)
| 2391 | * 4:5 - dashed underline |
| 2392 | */ |
| 2393 | private _processUnderline(style: number, attr: IAttributeData): void { |
| 2394 | // treat extended attrs as immutable, thus always clone from old one |
| 2395 | // this is needed since the buffer only holds references to it |
| 2396 | attr.extended = attr.extended.clone(); |
| 2397 | |
| 2398 | // default to 1 == single underline |
| 2399 | if (!~style || style > 5) { |
| 2400 | style = 1; |
| 2401 | } |
| 2402 | attr.extended.underlineStyle = style; |
| 2403 | attr.fg |= FgFlags.UNDERLINE; |
| 2404 | |
| 2405 | // 0 deactivates underline |
| 2406 | if (style === 0) { |
| 2407 | attr.fg &= ~FgFlags.UNDERLINE; |
| 2408 | } |
| 2409 | |
| 2410 | // update HAS_EXTENDED in BG |
| 2411 | attr.updateExtended(); |
| 2412 | } |
| 2413 | |
| 2414 | private _processSGR0(attr: IAttributeData): void { |
| 2415 | attr.fg = DEFAULT_ATTR_DATA.fg; |
no test coverage detected