"xterm-256color"와 "putty-256color"의 차이점은 무엇입니까?

"xterm-256color"와 "putty-256color"의 차이점은 무엇입니까?

제목에서 알 수 있듯이 차이점이 무엇인가요?

언제 이 중 하나를 사용해야 합니까?

또한 putty-256color에 대한 termcap/terminfo의 "표준" 정의를 얻은 사람이 있습니까? Google은 검색에 큰 도움이 되지 않습니다. 이런, Google은 이 문제에 대한 모든 질문에 거의 도움이 되지 않았습니다!

답변1

putty-256colorncurses에는 다른 terminfo 항목과 마찬가지로 terminfo 항목이 함께 제공됩니다 .

최소한 Ubuntu 20.04에서는 terminfo 항목이 ncurses-base(기본적으로 포함됨)과 ncurses-term(포함되지 않음)으로 구분됩니다. putty-256color후자 에 속합니다 .

둘 다 사용할 수 있는 경우( 이 Ubuntu 버전에 한 번 이상 설치됨) 및 를 ncurses-term결합할 수 있습니다 .xterm-256colorputty-256colorinfocmp

misc/terminfo.srcncurses 소스에서 이러한 항목에 대한 소스 정의를 볼 수도 있습니다 .온라인최신 버전의 경우(퍼티부분). 존재하다 ncurses-6.2-20201107,

putty-256color|PuTTY 0.58 with xterm 256-colors,
        use=xterm+256setaf, use=putty,

putty(비록 항목 위의 설명 에서 0.71을 언급했듯이 0.58은 오해의 소지가 있을 수 있습니다 .)

그러면 기본 정의가 포함되어 있고 putty256색과 동일한 순서가 포함되어 있음을 알 수 있습니다.xterm

infocmp -xL putty-256color xterm-256color해당 버전의 ncurses로 실행하면 다음과 같은 결과를 얻습니다.

comparing putty-256color to xterm-256color.
    comparing booleans.
    auto_left_margin: T:F.
    backspaces_with_bs: F:T.
    can_change: F:T.
    has_meta_key: F:T.
    has_status_line: T:F.
    no_pad_char: F:T.
    prtr_silent: F:T.
    xon_xoff: T:F.
    AX: F:T.
    comparing numbers.
    columns: NULL, 80.
    lines: NULL, 24.
    no_color_video: 22, NULL.
    U8: 1, NULL.
    comparing strings.
    acs_chars: '``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~', '``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~'.
    clear_margins: NULL, '\E[?69l'.
    clear_screen: '\E[H\E[J', '\E[H\E[2J'.
    cursor_down: '\ED', '\n'.
    cursor_normal: '\E[?25h', '\E[?12l\E[?25h'.
    cursor_up: '\EM', '\E[A'.
    cursor_visible: NULL, '\E[?12;25h'.
    dis_status_line: '\E]0;^G', NULL.
    display_pc_char: '%?%p1%{8}%=%t\E%%G\342\227\230\E%%@%e%p1%{10}%=%t\E%%G\342\227\231\E%%@%e%p1%{12}%=%t\E%%G\342\231\0\E%%@%e%p1%{13}%=%t\E%%G\342\231\252\E%%@%e%p1%{14}%=%t\E%%G\342\231\253\E%%@%e%p1%{15}%=%t\E%%G\342\230\274\E%%@%e%p1%{27}%=%t\E%%G\342\206\220\E%%@%e%p1%{155}%=%t\E%%G\340\202\242\E%%@%e%p1%c%;', NULL.
    ena_acs: '\E(B\E)0', NULL.
    enter_alt_charset_mode: '^N', '\E(0'.
    enter_ca_mode: '\E[?47h', '\E[?1049h\E[22;0;0t'.
    enter_dim_mode: NULL, '\E[2m'.
    enter_italics_mode: NULL, '\E[3m'.
    enter_pc_charset_mode: '\E[11m', NULL.
    enter_secure_mode: NULL, '\E[8m'.
    exit_alt_charset_mode: '^O', '\E(B'.
    exit_attribute_mode: '\E[m^O', '\E(B\E[m'.
    exit_ca_mode: '\E[2J\E[?47l', '\E[?1049l\E[23;0;0t'.
    exit_italics_mode: NULL, '\E[23m'.
    exit_pc_charset_mode: '\E[10m', NULL.
    from_status_line: '^G', NULL.
    init_2string: '\E7\E[r\E[m\E[?7h\E[?1;4;6l\E[4l\E8\E>\E]R', '\E[\041p\E[?3;4l\E[4l\E>'.
    initialize_color: NULL, '\E]4;%p1%d;rgb\072%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\'.
    key_a1: '\EOq', '\EOw'.
    key_a3: '\EOs', '\EOy'.
    key_b2: '\EOr', '\EOu'.
    key_backspace: '\177', '^H'.
    key_c1: '\EOp', '\EOq'.
    key_c3: '\EOn', '\EOs'.
    key_end: '\E[4~', '\EOF'.
    key_f0: '\EOy', NULL.
    key_f1: '\E[11~', '\EOP'.
    key_f13: '\E[25~', '\E[1;2P'.
    key_f14: '\E[26~', '\E[1;2Q'.
    key_f15: '\E[28~', '\E[1;2R'.
    key_f16: '\E[29~', '\E[1;2S'.
    key_f17: '\E[31~', '\E[15;2~'.
    key_f18: '\E[32~', '\E[17;2~'.
    key_f19: '\E[33~', '\E[18;2~'.
    key_f2: '\E[12~', '\EOQ'.
    key_f20: '\E[34~', '\E[19;2~'.
    key_f21: NULL, '\E[20;2~'.
    key_f22: NULL, '\E[21;2~'.
    key_f23: NULL, '\E[23;2~'.
    key_f24: NULL, '\E[24;2~'.
    key_f25: NULL, '\E[1;5P'.
    key_f26: NULL, '\E[1;5Q'.
    key_f27: NULL, '\E[1;5R'.
    key_f28: NULL, '\E[1;5S'.
    key_f29: NULL, '\E[15;5~'.
    key_f3: '\E[13~', '\EOR'.
    key_f30: NULL, '\E[17;5~'.
    key_f31: NULL, '\E[18;5~'.
    key_f32: NULL, '\E[19;5~'.
    key_f33: NULL, '\E[20;5~'.
    key_f34: NULL, '\E[21;5~'.
    key_f35: NULL, '\E[23;5~'.
    key_f36: NULL, '\E[24;5~'.
    key_f37: NULL, '\E[1;6P'.
    key_f38: NULL, '\E[1;6Q'.
    key_f39: NULL, '\E[1;6R'.
    key_f4: '\E[14~', '\EOS'.
    key_f40: NULL, '\E[1;6S'.
    key_f41: NULL, '\E[15;6~'.
    key_f42: NULL, '\E[17;6~'.
    key_f43: NULL, '\E[18;6~'.
    key_f44: NULL, '\E[19;6~'.
    key_f45: NULL, '\E[20;6~'.
    key_f46: NULL, '\E[21;6~'.
    key_f47: NULL, '\E[23;6~'.
    key_f48: NULL, '\E[24;6~'.
    key_f49: NULL, '\E[1;3P'.
    key_f50: NULL, '\E[1;3Q'.
    key_f51: NULL, '\E[1;3R'.
    key_f52: NULL, '\E[1;3S'.
    key_f53: NULL, '\E[15;3~'.
    key_f54: NULL, '\E[17;3~'.
    key_f55: NULL, '\E[18;3~'.
    key_f56: NULL, '\E[19;3~'.
    key_f57: NULL, '\E[20;3~'.
    key_f58: NULL, '\E[21;3~'.
    key_f59: NULL, '\E[23;3~'.
    key_f60: NULL, '\E[24;3~'.
    key_f61: NULL, '\E[1;4P'.
    key_f62: NULL, '\E[1;4Q'.
    key_f63: NULL, '\E[1;4R'.
    key_home: '\E[1~', '\EOH'.
    key_sdc: NULL, '\E[3;2~'.
    key_send: NULL, '\E[1;2F'.
    key_sf: '\E[B', '\E[1;2B'.
    key_shome: NULL, '\E[1;2H'.
    key_sic: NULL, '\E[2;2~'.
    key_sleft: NULL, '\E[1;2D'.
    key_snext: NULL, '\E[6;2~'.
    key_sprevious: NULL, '\E[5;2~'.
    key_sr: '\E[A', '\E[1;2A'.
    key_sright: NULL, '\E[1;2C'.
    key_suspend: '^Z', NULL.
    memory_lock: NULL, '\El'.
    memory_unlock: NULL, '\Em'.
    meta_off: NULL, '\E[?1034l'.
    meta_on: NULL, '\E[?1034h'.
    newline: '\r\n', NULL.
    orig_colors: '\E]R', '\E]104^G'.
    parm_ich: NULL, '\E[%p1%d@'.
    print_screen: NULL, '\E[i'.
    prtr_off: NULL, '\E[4i'.
    prtr_on: NULL, '\E[5i'.
    repeat_char: NULL, '%p1%c\E[%p2%{1}%-%db'.
    reset_1string: NULL, '\Ec\E]104^G'.
    reset_2string: '\E<\E["p\E[50;6"p\Ec\E[?3l\E]R\E[?1000l', '\E[\041p\E[?3;4l\E[4l\E>'.
    set0_des_seq: '\E[10m', NULL.
    set1_des_seq: '\E[11m', NULL.
    set2_des_seq: '\E[12m', NULL.
    set_attributes: '\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t^N%e^O%;', '%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p5%t;2%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m'.
    set_lr_margin: NULL, '\E[?69h\E[%i%p1%d;%p2%ds'.
    to_status_line: '\E]0;', NULL.
    user8: '\E[?6c', '\E[?%[;0123456789]c'.
    Cr: NULL, '\E]112^G'.
    Cs: NULL, '\E]12;%p1%s^G'.
    Ms: NULL, '\E]52;%p1%s;%p2%s^G'.
    Se: NULL, '\E[2 q'.
    Ss: NULL, '\E[%p1%d q'.
    TS: '\E]0;', NULL.
    kDC3: NULL, '\E[3;3~'.
    kDC4: NULL, '\E[3;4~'.
    kDC5: NULL, '\E[3;5~'.
    kDC6: NULL, '\E[3;6~'.
    kDC7: NULL, '\E[3;7~'.
    kDN: NULL, '\E[1;2B'.
    kDN3: NULL, '\E[1;3B'.
    kDN4: NULL, '\E[1;4B'.
    kDN5: NULL, '\E[1;5B'.
    kDN6: NULL, '\E[1;6B'.
    kDN7: NULL, '\E[1;7B'.
    kEND3: NULL, '\E[1;3F'.
    kEND4: NULL, '\E[1;4F'.
    kEND5: NULL, '\E[1;5F'.
    kEND6: NULL, '\E[1;6F'.
    kEND7: NULL, '\E[1;7F'.
    kHOM3: NULL, '\E[1;3H'.
    kHOM4: NULL, '\E[1;4H'.
    kHOM5: NULL, '\E[1;5H'.
    kHOM6: NULL, '\E[1;6H'.
    kHOM7: NULL, '\E[1;7H'.
    kIC3: NULL, '\E[2;3~'.
    kIC4: NULL, '\E[2;4~'.
    kIC5: NULL, '\E[2;5~'.
    kIC6: NULL, '\E[2;6~'.
    kIC7: NULL, '\E[2;7~'.
    kLFT3: NULL, '\E[1;3D'.
    kLFT4: NULL, '\E[1;4D'.
    kLFT5: NULL, '\E[1;5D'.
    kLFT6: NULL, '\E[1;6D'.
    kLFT7: NULL, '\E[1;7D'.
    kNXT3: NULL, '\E[6;3~'.
    kNXT4: NULL, '\E[6;4~'.
    kNXT5: NULL, '\E[6;5~'.
    kNXT6: NULL, '\E[6;6~'.
    kNXT7: NULL, '\E[6;7~'.
    kPRV3: NULL, '\E[5;3~'.
    kPRV4: NULL, '\E[5;4~'.
    kPRV5: NULL, '\E[5;5~'.
    kPRV6: NULL, '\E[5;6~'.
    kPRV7: NULL, '\E[5;7~'.
    kRIT3: NULL, '\E[1;3C'.
    kRIT4: NULL, '\E[1;4C'.
    kRIT5: NULL, '\E[1;5C'.
    kRIT6: NULL, '\E[1;6C'.
    kRIT7: NULL, '\E[1;7C'.
    kUP: NULL, '\E[1;2A'.
    kUP3: NULL, '\E[1;3A'.
    kUP4: NULL, '\E[1;4A'.
    kUP5: NULL, '\E[1;5A'.
    kUP6: NULL, '\E[1;6A'.
    kUP7: NULL, '\E[1;7A'.
    ka2: NULL, '\EOx'.
    kb1: NULL, '\EOt'.
    kb3: NULL, '\EOv'.
    kc2: NULL, '\EOr'.
    kp5: NULL, '\EOE'.
    kpADD: NULL, '\EOk'.
    kpCMA: NULL, '\EOl'.
    kpDIV: NULL, '\EOo'.
    kpDOT: NULL, '\EOn'.
    kpMUL: NULL, '\EOj'.
    kpSUB: NULL, '\EOm'.
    kpZRO: NULL, '\EOp'.
    rmxx: NULL, '\E[29m'.
    smxx: NULL, '\E[9m'.

전체 항목 덤프의 경우 putty-256color( 포함 infocmp -x):

#   Reconstructed via infocmp from file: /home/chazelas/install/ncurses-6.2-20201107/INSTALL.d/share/terminfo/p/putty-256color
putty-256color|PuTTY 0.58 with xterm 256-colors,
    am, bce, bw, hs, mir, msgr, xenl, xon, XT,
    colors#0x100, it#8, ncv#22, pairs#0x7fff, U8#1,
    acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
    bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
    clear=\E[H\E[J, cnorm=\E[?25h, cr=\r,
    csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
    cud=\E[%p1%dB, cud1=\ED, cuf=\E[%p1%dC, cuf1=\E[C,
    cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\EM,
    dch=\E[%p1%dP, dch1=\E[P,
    dispc=%?%p1%{8}%=%t\E%%G\342\227\230\E%%@%e%p1%{10}%=%t\E%%G\342\227\231\E%%@%e%p1%{12}%=%t\E%%G\342\231\0\E%%@%e%p1%{13}%=%t\E%%G\342\231\252\E%%@%e%p1%{14}%=%t\E%%G\342\231\253\E%%@%e%p1%{15}%=%t\E%%G\342\230\274\E%%@%e%p1%{27}%=%t\E%%G\342\206\220\E%%@%e%p1%{155}%=%t\E%%G\340\202\242\E%%@%e%p1%c%;,
    dl=\E[%p1%dM, dl1=\E[M, dsl=\E]0;\007, ech=\E[%p1%dX,
    ed=\E[J, el=\E[K, el1=\E[1K, enacs=\E(B\E)0,
    flash=\E[?5h$<100/>\E[?5l, fsl=^G, home=\E[H,
    hpa=\E[%i%p1%dG, ht=^I, hts=\EH, il=\E[%p1%dL, il1=\E[L,
    ind=\n, indn=\E[%p1%dS,
    is2=\E7\E[r\E[m\E[?7h\E[?1;4;6l\E[4l\E8\E>\E]R,
    ka1=\EOq, ka3=\EOs, kb2=\EOr, kbs=^?, kc1=\EOp, kc3=\EOn,
    kcbt=\E[Z, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
    kdch1=\E[3~, kend=\E[4~, kent=\EOM, kf0=\EOy, kf1=\E[11~,
    kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, kf13=\E[25~,
    kf14=\E[26~, kf15=\E[28~, kf16=\E[29~, kf17=\E[31~,
    kf18=\E[32~, kf19=\E[33~, kf2=\E[12~, kf20=\E[34~,
    kf3=\E[13~, kf4=\E[14~, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~,
    kf8=\E[19~, kf9=\E[20~, khome=\E[1~, kich1=\E[2~,
    kind=\E[B, kmous=\E[<, knp=\E[6~, kpp=\E[5~, kri=\E[A,
    kspd=^Z, nel=\r\n, oc=\E]R, op=\E[39;49m, rc=\E8, rev=\E[7m,
    ri=\EM, rin=\E[%p1%dT, rmacs=^O, rmam=\E[?7l,
    rmcup=\E[2J\E[?47l, rmir=\E[4l, rmkx=\E[?1l\E>,
    rmpch=\E[10m, rmso=\E[27m, rmul=\E[24m,
    rs2=\E<\E["p\E[50;6"p\Ec\E[?3l\E]R\E[?1000l,
    s0ds=\E[10m, s1ds=\E[11m, s2ds=\E[12m, sc=\E7,
    setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
    setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
    sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;,
    sgr0=\E[m\017, smacs=^N, smam=\E[?7h, smcup=\E[?47h,
    smir=\E[4h, smkx=\E[?1h\E=, smpch=\E[11m, smso=\E[7m,
    smul=\E[4m, tbc=\E[3g, tsl=\E]0;, u6=\E[%i%d;%dR, u7=\E[6n,
    u8=\E[?6c, u9=\E[c, vpa=\E[%i%p1%dd, E3=\E[3J, TS=\E]0;,
    XM=\E[?1006;1000%?%p1%{1}%=%th%el%;,
    xm=\E[<%i%p3%d;%p1%d;%p2%d;%?%p4%tM%em%;,

이 항목은 버전에 따라 변경될 수 있습니다 ncurses. 예를 들어 Ubuntu 20.04 항목(6.2-0ubuntu2 패키지, 6.2-20200212 업스트림)과 위의 6.2-20201107 항목 사이에는 다음이 표시됩니다.

$ infocmp -A /usr/share/terminfo -B . putty-256color putty-256color
comparing putty-256color to putty-256color.
    comparing booleans.
    comparing numbers.
        pairs: 65536, 32767.
    comparing strings.
        kLFT: '\E[D', NULL.
        kRIT: '\E[C', NULL.
        ka1: NULL, '\EOq'.
        ka3: NULL, '\EOs'.
        kb2: '\E[G', '\EOr'.
        kc1: NULL, '\EOp'.
        kc3: NULL, '\EOn'.
        kent: NULL, '\EOM'.
        kf0: NULL, '\EOy'.

바라보다변경 내역 내부terminfo.src그리고ncurses NEWS파일더 알아보기.

Putty 및 xterm 문제와 관련하여 추가 내용은 다음과 같습니다.

참고로 동일인물입니다(@토마스디키, 여기의 최고 기여자이자 일반 터미널 참조)는 ncurses 및 xterm을 유지 관리합니다.

관련 정보