![XTerm 프린터 명령 출력의 추가 문자](https://linux55.com/image/24842/XTerm%20%ED%94%84%EB%A6%B0%ED%84%B0%20%EB%AA%85%EB%A0%B9%20%EC%B6%9C%EB%A0%A5%EC%9D%98%20%EC%B6%94%EA%B0%80%20%EB%AC%B8%EC%9E%90.png)
내가 설정해놨어.Xresources
Alt-를 누르면 터미널 내용을 파일로 인쇄할 수 있습니다 P.
XTerm*printAttributes: 2
XTerm*printerCommand: cat - > "`mktemp --tmpdir xterm-screenshot.bin.XXXXXXXXXX`"
XTerm.VT100.translations: #override Meta <KeyPress> P: print() \n
출력의 각 줄에 일부 이스케이프 문자와 리터럴이 접두사로 붙는 것을 제외하면 이것은 잘 작동하는 것 같습니다 #5
. 세션 시작 시 출력을 비교합니다 xterm
.
user^2@host:~
$
ESC#5ESC[0m
처음에는 그게 정상인가요?
less /tmp/xterm-screenshot.bin.*
:
ESC#5ESC[0muserESC[0;1;33m^2ESC[0m@host:ESC[0;1;34m~ESC[0m
ESC#5ESC[0m$ ESC[0m
less -R /tmp/xterm-screenshot.bin.*
:
[0muser^2@host:~
[0m$
추가 정보:
$ xterm -version
XTerm(271)
$ uname -a
Linux user 3.2.0-27-generic #43-Ubuntu SMP Fri Jul 6 14:46:35 UTC 2012 i686 i686 i386 GNU/Linux
답변1
print()
예, xTerm이 모든 속성을 갖도록 구체적으로 요청했기 때문입니다 .
XTerm*printAttributes: 2
즉, 출력 파일에는 xTerm으로 전송된 전체 바이트 시퀀스가 포함되어 있으며 그런 다음 less
(일반, 스위치 없음)을 사용하여읽다터미널에 표시되는 내용(다양한 속성 포함)의 텍스트 버전을 얻을 수 있습니다. 문제의 파일은 다음과 같습니다.
[me ~]$ file -b /tmp/xterm-screenshot.bin.HBsmSPRrFx
ASCII text, with CRLF line terminators, with escape sequences
-r
( --raw-control-chars
)를 less
사용해야 합니다.보다파일 내용은 터미널에 표시되는 내용과 동일합니다.
less -r /tmp/xterm-screenshot.bin.HBsmSPRrFx
출력 파일에 이스케이프 시퀀스를 원하지 않는 경우(즉, 그래픽 속성이 없는 일반 텍스트 파일을 원하는 경우) 다음을 사용해야 합니다.
XTerm*printAttributes: 0
당신의 ~/.Xresources
. ~에서xTerm 매뉴얼:
printAttributes (class PrintAttributes)
Specifies whether to print graphic attributes along with the text. A real DEC VTxxx terminal
will print the underline, highlighting codes but your printer may not handle these. A "0"
disables the attributes. A "1" prints the normal set of attributes (bold, underline, inverse
and blink) as VT100-style control sequences. A "2" prints ANSI color attributes as well.