· KLDP.org · KLDP.net · KLDP Wiki · KLDP BBS ·
Linuxdoc Sgml/Xterm-Title

xterm-title mini howto

xterm-title mini howto

winni@xpilot.org

version 1.3 1996³â 10¿ù 22ÀÏ ¹ø¿ª: ÃÖÁ¾È¯ saxboy@saxboy.pe.kr
´ÙÀ½Àº xterm-title mini howto¸¦ ¹ø¿ªÇÑ °ÍÀÔ´Ï´Ù. ¹ø¿ªÇϸ鼭 ¿ì¸®¸»·Î ¿Å°Ü¼­ ¾î»öÇÒ °Í °°Àº ºÎºÐÀº ±×³É ¿µ¾î·Î ½è½À´Ï´Ù. ±×¸®°í ¹ø¿ªÀº ÀÇ¿ªÀ» À§ÁÖ·Î ÇÏ¿´°í ÀúÀÚÀÇ Àǵµ¿Í ¾î±ß³ªÁö ¾Ê´Â ¹üÀ§¿¡¼­ ¾à°£ÀÇ ¸»À» ¹Ù²Û °÷µµ ÀÖ½À´Ï´Ù. Âü°í·Î ÀúÀÚ°¡ Çʸ®ÇÉÀÎ Àεí Çѵ¥, À̸§¿¡ Ư¼ö ¹®ÀÚ°¡ Àִµí..Çؼ­ ±ÛÀÚ°¡ ±úÁø °ü°è·Î E-mail address¸¸À» Ç¥±âÇß½À´Ï´Ù.

1. ¼Ò°³

"±ÍÂúÁö ¾Ê¾Æ¿ä?" ¶ó°í ´ëºÎºÐ ¹°¾îº¾´Ï´Ù. Àü xterm -T "¾²°í ½ÍÀº¸»" \ -n "¾ÆÀÌÄÜ À̸§µµ ¹Ù²Ü¼ö ÀÖ³×.." & ¶ó°í ½á¼­ xterm ŸÀÌƲ¹Ù¿¡ ¾²°í ½ÍÀº ¸»À» ¾¹´Ï´Ù. ±×·¸°Ô ÇÏ¸é µÇ°ÚÁö¸¸, xtermÀ» ¶ç¿ì°í ³ª¼­ ŸÀÌƲ ¹Ù¸¦ ¹Ù²Ù°í ½ÍÀ¸¸é ¾î¶±ÇÏÁÒ?

xtermÀÌ ¶°ÀÖÀ»¶§ ŸÀÌƲÀ» ¹Ù²Ù°í ½ÍÀ¸¸é Ư¼ö¹®ÀÚ¿­À» º¸³»ÁÖ¸é µË´Ï´Ù. ÀÌ·± Ư¼öÇÑ ¹®ÀÚ¿­À» "escape sequence"¶ó°í ºÎ¸£°í, µ¿ÀÛÀº ÇÏÁö¸¸ È­¸é¿¡´Â ³ª¿ÀÁö ¾Ê´Â °ÍÀÌ º¸ÅëÀÌÁÒ. ¿¹¸¦ µé¾î¼­ <ctrl-v><Esc><c><Enter>¸¦ ´©¸£¸é xtermÀ» ¸®¼Â½Ãų¼ö ÀÖ½À´Ï´Ù. (È­¸éÀ» Áö¿ì´Â °Í ¸»ÀÔ´Ï´Ù. ) À̶§ <ctrl-v>´Â bash°¡ <esc><c>¸¦ ¾Ë¾Æ¸Ô°Ô ÇÏ·Á°í ¾²´Â °Ì´Ï´Ù.

Àú´Â Å° ¿©·¯°³¸¦ ´©¸£´Â °ÍÀ» <>·Î ±¸ºÐÇϴϱî ÁÖÀÇÇϼ¼¿ä.

±×·¯¸é, xtermÀÇ Å¸ÀÌƲ¹Ù¿Í ¾ÆÀÌÄÜ À̸§À» ¹Ù²Ù·Á¸é (xtermÀÌ ¶° ÀÖÀ»¶§) ´ÙÀ½ escape-sequence¸¦ ÁÖ¼¼¿ä.

<esc> <]> <2> <;> ŸÀÌƲ ¹Ù À̸§À» ¹Ù²Ü¶§

<esc> <]> <1> <;> ¾ÆÀÌÄÜ À̸§À» ¹Ù²Ü¶§

ÀÌ ¹®ÀÚ¿­À» xtermÀÌ ¾Ë¾Æ¸Ô°Ô ¸¸µé·Á¸é Ä¿¸Çµå¶óÀο¡¼­ Ä¡Áö ¸»°í, 'echo'ÇÁ·Î±×·¥À» »ç¿ëÇϼ¼¿ä.

echo -e "\033]2; ¾²°í ½ÍÀº ¸». \007"
ÀÌ¹Ì ¿¹»óÇß°ÚÁö¸¸ \033Àº esc¸¦ 8Áø¼ö·Î ¾´ °ÍÀÌ°í '-e'´Â echo°¡ ÀÌ·± ½ÄÀ¸·Î ½áµµ ¾Ë¾Æµè°Ô ¸¸µé¾î ÁÖ´Â ¿É¼ÇÀÔ´Ï´Ù. ¹®ÀÚ¿­À» ´Ù ½èÀ¸¸é "ÀÌ»Ú°Ô »à»à°Å¸®´Â" <ctrl-g>·Î ³¡³»¾ß ÇÕ´Ï´Ù.

À§¿¡¼­ º» °ÍÀ» ½á¸Ô±â ÁÁÀº °÷ÀÌ Àִµ¥ ¹Ù·Î Ä¿¸ÇµåÇÁ·ÒÇÁÆ®¸¦ xtermŸÀÌƲ¿¡ ¾²´Â°Ì´Ï´Ù. ? Ä¿¸ÇµåÇÁ·ÒÇÁÆ®¸¦ ÀÌ·¸°Ô ¾´´Ù°í »ý°¢ÇغÁ¿ä.

   export PS1='\u@\h:\w> '
±×·¯¸é Ä¿¸Çµå ÇÁ·ÒÇÁÆ®°¡ ÀÌ·¸°Ô º¸ÀÌ°ÚÁÒ.
   winni@FeilSurf:~/mail>
À̶§ µð·ºÅ丮¸¦ "/somewhere/else"·Î ¿Å±â¸é ¾î¶»°Ô µÉ±î¿ä? ±×·¸ÁÒ, ÇÁ·ÒÇÁÆ®°¡ ±æ¾îÁ®¼­ ŸÀÌÇÎÇÒ ÀÚ¸®°¡ ÁÙ¾îµé°ÚÁÒ. ÀÌ·¸°Ô ¸»ÀÔ´Ï´Ù.
   winni@FeilSurf:/somewhere/else 
Á» ÀÌ»óÇÏÁö¸¸ ŸÀÌƲ ¹Ù¿¡´Ù°¡ ÀÌ·¸°Ô ¾²°í ½Í´Ù¸é...
   export PS1='\033]2; \u@\h:\2 \007bash> '
±×·¯¸é escape-sequence´Â xtermÀ¸·Î µé¾î°¡°í ÇÁ·ÒÇÁÆ®¿¡´Â À̰͸¸ ³²½À´Ï´Ù.
   bash> _
À¯°¨½º·´Áö¸¸ PS1Àº 60ÀÚÁ¤µµ±îÁö¸¸ ¾µ ¼ö ÀÖ°í, ±×·¡¼­ ¾Æ¹«¶§³ª À§¿¡ ÀÖ´Â °Íó·³ ÇÏ¸é µÇ´Â °Í ¾Æ´Õ´Ï´Ù. 'cd'°°Àº ½© ³»ºÎ ¸í·É¾î¸¦ ¹Ù²ã¼­ À§¿Í °°ÀÌ ÇÒ ¼öµµ ÀÖÁö¸¸, ±×·¯¸é ½ºÅ©¸³Æ®¸¦ µ¹¸±¶§ ŸÀÌƲ¹Ù°¡ ¾ÆÁÖ ÀÌ»óÇÏ°Ô µÇ¾î ¹ö¸®ÁÒ. (cdÇÒ ¶§ ¸¶´Ù ŸÀÌƲ¹Ù°¡ ¹Ù²î´Ï±î ¸»ÀÌÁÒ. ) (¿ªÁÖ: alias cd '\033]2; .... ' <- ÀÌ·± ½ÄÀ¸·Î ¾²¸é )

Á¦ÀÏ ÁÁÀº ¹æ¹ýÀº ȯ°æº¯¼ö "PROMPT_COMMAND"¸¦ ¹Ù²Ù´Â ¹æ¹ýÀÔ´Ï´Ù. ÀÌ º¯¼ö¿¡ ÀÖ´Â ³»¿ëÀº ÇÁ·Î±×·¥ÀÌ ½ÇÇàµÇ°í, bash°¡ ÇÁ·ÒÇÁÆ®¸¦ ´Ù½Ã Âï±âÀü¿¡ ġȯµË´Ï´Ù. ´ÙÀ½°ú °°ÀÌ ÇÏ¸é ³×Æ®¿÷À» ¾µ¼ö ÀÖ´Â °÷¿¡¼­ xtermÀ» ¸¹ÀÌ ¿­¾îµÎ¾úÀ»¶§ À¯¿ëÇÏ°Ô ¾µ¼ö ÀÖ½À´Ï´Ù.

   export PROMPT_COMMAND='echo -ne "\033]2;$LOGNAME$HOST  Dir: $PWD\007\033]1;$LOGNAME@$HOST\007"'
ƯÈ÷ À©µµ¿ì¸Å´ÏÀú¿¡¼­ "window list"¿¡¼­µµ Á¦´ë·Î º¸ÀÔ´Ï´Ù. ¿Ïº®À» ±âÇؼ­ xterm¾È¿¡ ÀÖÀ»¶§¸¸ À̺¯¼ö°¡ ¼ÂÆõǵµ·Ï ÇÏ¸é µË´Ï´Ù.
   if [ "$TERM" = "xterm" -o "$TERM" = "xterm-color" -o \
        "$TERM" = "rxvt" -o "$TERM" = "vs100" ]
   then 
     PS1='bash> '
     PS2='bash>> '
     PS1='bash>>> '

     export PROMPT_COMMAND='echo -ne "\033]2;$LOGNAME$HOST  Dir: $PWD\007\033]1;$LOGNAME@$HOST\007"'
   fi

"bash>"¸¦ ÇÁ·ÒÇÁÆ®¿¡ ½áÁÖ´Â °ÍÀº Ä¿¸Çµå¶óÀÎÀÌ ¾ÈÁ¤ÀûÀ̵µ·Ï µµ¿ÍÁÝ´Ï´Ù. gnuplotÀ̳ª ncftp, gap, kash°°Àº ÇÁ·Î±×·¥µéÀº ÀÚ±â À̸§À» ¾²´Â °æ¿ì°¡ ¸¹±â ¶§¹®ÀÔ´Ï´Ù. ÀÌ·¸°Ô±îÁö Çصµ ytalk°°ÀÌ ¼­ºê½©À» ºÎ¸£´Â ÇÁ·Î±×·¥¿¡¼­´Â ¶Ç ¾û¸ÁÀÌ µÇÁÒ. ±×·¯¸é..

   unset PROMPT_COMMAND
¸¦ ÇØ ÁÖ¼¼¿ä.

linux Áñ°Ì°Ô ¾²¼¼¿ä - winni@xpilot.org

CREDITS:

Ville Voutilainen vvoutila@raita.oulu.fi Noticed the ;s are missing from the escape-sequence in the "first half" of the document.

PS:

´Ù¸¥ ÇÁ·Î±×·¥µé¿¡¼­ °ð¹Ù·Î "escape-sequences"¸¦ ¾²Áö ¸¶¼¼¿ä. (¿ªÁÖ: Ä¿¸Çµå¶óÀο¡¼­ ±×³É ¾´´Ù°Å³ª ÇÏ´Â ½ÄÀ¸·Î...) ÇÁ·Î±×·¥ÀÌ È¯°æº¯¼ö '$TERM"¿¡¼­ ¹Þµµ·Ï ±×³É µÎ¼¼¿ä. ÀÚ¼¼ÇÑ »çÇ×Àº tput(1)À» º¸¸é µË´Ï´Ù. ( man 1 tput À̶ó°í ÇÏ¸é µË´Ï´Ù. )

PS2:

xterms¿¡¼­ ¾²´Â escape-sequenceµéÀ» ¾Ë°í ½ÍÀ¸¸é rxvt¼Ò½ºÄڵ带 º¸¼¼¿ä. "doc/"µð·ºÅ丮 ¾È¿¡ "xterm.seq"¶ó´Â È­ÀÏÀÌ ÀÖ½À´Ï´Ù.


ID
Password
Join
It is better to wear out than to rust out.


sponsored by andamiro
sponsored by cdnetworks
sponsored by HP

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2010-01-29 00:25:34
Processing time 0.0036 sec