diff --git a/css/xterm.css b/css/xterm.css index 95fc61edc..e9fd8153f 100644 --- a/css/xterm.css +++ b/css/xterm.css @@ -163,9 +163,11 @@ opacity: 0.5; } -.xterm-underline { - text-decoration: underline; -} +.xterm-underline-1 { text-decoration: underline; } +.xterm-underline-2 { text-decoration: double underline; } +.xterm-underline-3 { text-decoration: wavy underline; } +.xterm-underline-4 { text-decoration: dotted underline; } +.xterm-underline-5 { text-decoration: dashed underline; } .xterm-strikethrough { text-decoration: line-through; diff --git a/src/browser/renderer/dom/DomRendererRowFactory.ts b/src/browser/renderer/dom/DomRendererRowFactory.ts index fadf50325..47f4b31c6 100644 --- a/src/browser/renderer/dom/DomRendererRowFactory.ts +++ b/src/browser/renderer/dom/DomRendererRowFactory.ts @@ -5,7 +5,7 @@ import { IBufferLine, ICellData, IColor } from 'common/Types'; import { INVERTED_DEFAULT_COLOR } from 'browser/renderer/atlas/Constants'; -import { NULL_CELL_CODE, WHITESPACE_CELL_CHAR, Attributes } from 'common/buffer/Constants'; +import { NULL_CELL_CODE, WHITESPACE_CELL_CHAR, Attributes, UnderlineStyle } from 'common/buffer/Constants'; import { CellData } from 'common/buffer/CellData'; import { IBufferService, ICoreService, IDecorationService, IOptionsService } from 'common/services/Services'; import { color, rgba } from 'common/Color'; @@ -155,16 +155,19 @@ export class DomRendererRowFactory { charElement.classList.add(DIM_CLASS); } - if (cell.isUnderline()) { - charElement.classList.add(UNDERLINE_CLASS); - } - if (cell.isInvisible()) { charElement.textContent = WHITESPACE_CELL_CHAR; } else { charElement.textContent = cell.getChars() || WHITESPACE_CELL_CHAR; } + if (cell.isUnderline()) { + charElement.classList.add(`${UNDERLINE_CLASS}-${cell.extended.underlineStyle}`); + if (charElement.textContent === ' ') { + charElement.innerHTML = ' '; + } + } + if (cell.isStrikethrough()) { charElement.classList.add(STRIKETHROUGH_CLASS); }