μΌλΆ VT100 μ΄μ€μΌμ΄ν μνμ€λ‘ μμ νλ λ° λͺ κ°μ§ λ¬Έμ κ° μμ΅λλ€.
μΌλ°μ μΌλ‘ VT100 ν°λ―Έλμ 컀μ μμΉλ₯Ό μ μ₯ν΄μΌνλ©° μ μ₯ 컀μ μ΄μ€μΌμ΄ν μνμ€λ₯Ό μμ±ν λ λ¬Έμ μμ±λ μ μ₯ν΄μΌν©λλ€.
볡μ 컀μλ₯Ό μΈ λ λ¬Έμ μμ±μ΄ 볡μλμ΄μΌν©λλ€.
νμ¬ μ»€μμ μμΉλ μ μ₯λκ³ λ³΅μ λμ§λ§ λ¬Έμ μμ±μ μλλλ€ .
λ€λ₯Έ VT100 ꡬνμμ μ μ₯ / 볡μ μ΄μ€μΌμ΄ν μνμ€μ λμμ ν μ€νΈνμ¬ μ²λ¦¬ μ€μΈμ§ νμΈνμ΅λλ€.
μλμ λͺ κ°μ§ μΈλΆ μ 보λ₯Ό μ 곡νκ³ λ μμ μ μν΄ νμνλ―λ‘ μ루μ
μμ
μ μμν κ²μ
λλ€.
μμΌλ‘λ νμ¨μ£ΌμΈμ!
ν μ€νΈμ μ¬μ©λλ VT100 μ΄μ€μΌμ΄ν μνμ€λ λ€μκ³Ό κ°μ΅λλ€.
\x1b[0m (attributes off)
\x1b[1;1f (reset origin)
\x1b[2J (clear)
\x1b7 (save cursor state)
\x1b[7m (set negative color)
<colored> (just some output)
\x1b8 (restore cursor state)
<should not be colored>\n\r (another output - will be printed in negative color in xtermjs)
xtermjsλ₯Ό μ¬μ©νλ©΄ "μμ΄ μ§μ λμ§ μμμΌ ν¨"μ΄ μμμΌλ‘ νμλ©λλ€.
xterm.write('\x1b[0m\x1b[1;1f\x1b[2J\x1b7\x1b[7m <colored>\x1b8<should not be colored>\n\r');
// will print:
// "<should not be colored> <colored>"
bashμμλ "μμ΄ μ§μ λμ§ μμμΌ ν¨"μ΄ μμμ΄ μ§μ λμ§ μμ΅λλ€.
printf '\x1b[0m\x1b[1;1f\x1b[2J\x1b7\x1b[7m <colored>\x1b8<should not be colored>\n\r'
# will print
# "<should not be colored> <colored>"
ν
μ€νΈ μμ±μ΄ μ¬κΈ° μμΉμ ν¨κ» μ μ₯λκ³ λ³΅μλμ΄μΌνλ€κ³ μκ°
λ€μμ htermμ΄ μ μ₯ / 볡μ 컀μλ₯Ό μ²λ¦¬νλ λ°©λ²μ
λλ€.
νΈμ§ :
λͺ¨λ λ¬Έμ μμ± (fg color, bg color λ° νΉμ νλκ·Έ λͺ¨λ : bold, italic, negative, ..)μ 'Terminal'ν΄λμ€μ 'curAttr'μμ±μ μ μ₯λ©λλ€. μ΄ μμ±μ 볡μ¬λ³Έμ μ μ₯νλ©΄ λͺ¨λ λ¬Έμ μμ±μ ν λ²μ 볡μ ν μ μμ΅λλ€.
VTEλ λ²κ·Έκ° λ§μμ΅λλ€. μλ§λ VTE 731205 μμ λͺ κ°μ§ ν₯λ―Έλ‘μ΄ λΆλΆμ μ°Ύμ μμμ κ²μ λλ€.
@ 7PH μ΄μ¨λ DECSCλ₯Ό μμ νκ³ μκΈ° λλ¬Έμ https://vt100.net/docs/vt510-rm/DECSC.htmlμ μ΄ν΄λ³Ό μ μμ΅λλ€. μμ§ μ²λ¦¬ν΄μΌ ν ν°λ―Έλ μμ±μ΄ λ μμ΅λλ€.
κ·Έλ μ§ μλ€λ©΄ λ³λμ λ¬Έμ λ₯Ό λ§λ€μ΄μΌν©λλ€. μ΄λ¬ν λͺ¨λ κ²μ μΊ‘μ²νλ €λ©΄ ICursorState
μν κ°μ²΄μ κ°μ λ°©μμΌλ‘ μμ
μ μ 리ν΄μΌν©λλ€.
PRμ λ³ν©νκ³ λλ¨Έμ§ μμ±μ https://github.com/xtermjs/xterm.js/issues/1526μΌλ‘ λΆκΈ°νμ΅λλ€.
κ°μ₯ μ μ©ν λκΈ
κ·Έλ μ§ μλ€λ©΄ λ³λμ λ¬Έμ λ₯Ό λ§λ€μ΄μΌν©λλ€. μ΄λ¬ν λͺ¨λ κ²μ μΊ‘μ²νλ €λ©΄
ICursorState
μν κ°μ²΄μ κ°μ λ°©μμΌλ‘ μμ μ μ 리ν΄μΌν©λλ€.