20080406:18:34 <@sunpoet> 請問一下,screen with big5-2003 patch,也設了 WITH_CJK,現在全形符號顯示的時候會變成半形符號加空格,就是寬度不變,但是顯示在左半邊,會是哪邊沒改到?
20080406:19:05 <@mhsin_bsd> sunpoet: ^A:cjkwidth on
20080406:19:06 <@mhsin_bsd> sunpoet: 然後你的 terminal emulator(PuTTY, rxvt, etc.)也要設相對應的 ambiguous width 設定
20080406:19:19 <NotExist> sunpoet: putty的話Windows->Translation右邊有Treat CKJ as wide
20080406:19:21 <@mhsin_bsd> sunpoet: 看到會加空白 => screen cjkwidth 沒開;符號變成窄版的 => terminal emulator 的 ambiguous width 沒設成寬字元
20080406:20:57 <@sunpoet> mhsin_bsd: NotExist: thanks,我少測了同時設 cjkwidth on 跟 Treat CJK as wide 的情形,現在解決了。
* * *
20080418:00:02 <@sunpoet> 原來之前改錯地方,現在 screenrc 裡面可以用 -b/-g 指定該視窗要哪個 encoding 啦。
20080418:00:09 <NotExist> sunpoet: 你用哪版@@ 我man沒看到 囧rz
20080418:00:14 <@sunpoet> NotExist: 自己 patch ...
20080418:00:19 <@sunpoet> NotExist: http://sunpoet.net/FreeBSD/screen-big5-gbk
20080418:00:20 <@sunpoet> 像這樣連大神的站 screen -b -t abpe 2 env LANG=C LC_ALL=en_US.ISO8859-1 telnet abpe.org
20080418:00:23 < NotExist> sunpoet: XD 感謝
20080418:00:24 <@sunpoet> NotExist: 因為我懶惰 :p
20080418:00:24 < NotExist> sunpoet: 科技始終來自於惰性 :p<
20080418:06:55 @Eintisy> sunpoet: 雖然只對 big5 的人有用,但 telnet 好像大部分也是 big5 的 bbs 會用... 這個 patch 幹得好啊~ :)
* * *
18:48 <@ijliao> 好像該來把 shell 環境弄成 utf-8 的...
18:48 <@ijliao> 不過不知道要怎麼上 bbs orz 用 screen 再轉嗎 @_@
18:49 <@mhsin_bsd> ^A:encoding big5?
18:49 <@mhsin_bsd> 設 key binding 快速切換?
18:50 <@mhsin_bsd> ijliao: 可以考慮留幾個窗設在 big5 專門上 B
18:50 <@ijliao> hmmm... 是個好主意
19:48 <@sunpoet> ijliao: 用 screen 轉啊,我現在上小鹿鹿跟 ptt/ptt2 都是這樣
20:04 <@knight> sunpoet: screen 怎麼 default utf8 然後下參數開 big5 window?
20:06 <@mhsin_bsd> ^A:defencoding utf8 ?
20:07 <@mhsin_bsd> 我都開窗之後再改 encoding
20:07 <@vvlng> 不是有人有 keybinding 的 config ?
20:07 <@vvlng> bind b encoding big5 utf-8
20:07 <@vvlng> bind u encoding utf-8 utf-8
20:08 <@vvlng> ctrl-a b 就變成 big5 window
20:23 <@lwhsu> 不過這樣有些 asciiart 看起來會怪怪的 @@
20:23 <@knight> y
20:23 <@knight> 不過那不是重點, 重點是想要搞 auto start script :~
20:23 <@knight> .screenrc 裡好像沒辦法自動開 big5 window
20:24 <@lwhsu> 多按一兩個鍵還可以接受 但是畫面醜是好幾個小時的事阿 :~
20:24 <@Jedi_> 腦內補完吧 *誤*
20:25 <@lwhsu> 我還是乖乖另外開一個 terminal 用 big5...
20:25 <@yinjieh> 不能開完再弄 encoding ?
20:25 <@mhsin_bsd> lwhsu: 因為沒上 cjkwidth?
20:25 <@mhsin_bsd> knight: 改 defencoding 再開?
20:25 <@knight> ...
20:26 <@lwhsu> mhsin_bsd: 你是說這個 option? CJK "Treat CJK ambiguous characters as full width" OFF
20:26 <@lwhsu> 我不確定我這台有沒有開...
20:26 <@knight> 就是想要 default utf8 然後用 screenrc 自動開一兩個窗 big5
20:27 <@mhsin_bsd> lwhsu: 那是 PuTTY 那邊的選項,然後 screen 也有個 cjkwidth 要調
20:28 <@lwhsu> mhsin_bsd: 我丟的那個是 sysutils/screen/Makefile 裡面的阿 @@
20:28 <@mhsin_bsd> knight: 改 defencoding、開窗、再改回來不行嗎?
20:28 <@lwhsu> mhsin_bsd: putty 裡面也有? 我找一下
20:28 <@mhsin_bsd> lwhsu: 喔喔看錯了 XDrz
20:29 <@mhsin_bsd> lwhsu: 對,Makefile 那個 KNOB 要開,然後 screen 就會有個 cjkwidth {on|off} 可以調
20:29 <@lwhsu> mhsin_bsd: 我剛看到了, 正在試
20:29 <@mhsin_bsd> 和 PuTTY 的都開起來
20:30 <@lwhsu> mhsin_bsd: 開了以後也很糟阿 XD
20:31 <@lwhsu> mhsin_bsd: 是都變 wide 了沒錯, 但是畫面還是會亂 @@
20:31 <@yinjieh> 開 make config 會很炫喔
20:32 <@knight> mhsin_bsd: 你說的方法似乎有效哩, thx :)
20:33 <@yinjieh> 賀
20:34 <@yinjieh> http://flickr.com/photos/37036611@N00/1676416856/
20:35 <@vvlng> yinjieh: refan's patch 也上一下吧
20:36 <@yinjieh> oh ok
20:36 <@mhsin_bsd> knight: :p
20:37 <@mhsin_bsd> lwhsu: 這...可能是吃到 UAO 字 / 一字雙色吧 @_@
20:37 <@lwhsu> mhsin_bsd: 嗯, 我想也是那些惡搞的東西 XD
20:38 <@mhsin_bsd> yinjieh: ncurses 表格是個很麻煩的東西
20:38 <@yinjieh> mhsin_bsd: yes, 所以我還是暫時都關掉 沒辦法 XD
20:38 <@mhsin_bsd> 上次好像研究過,忘了結論是什麼(ncurses 要 patch?)
20:39 <@yinjieh> ncurses 又在 base ? XD
20:40 <@mhsin_bsd> 呃還是 curses?
20:40 < rafan> 我自己是 patch screen
20:41 <@mhsin_bsd> rafan: how?
20:41 <@mhsin_bsd> 印象中是 curses 把表格當 half-width 造成的(?)
20:43 <@rafan> 換成 -+| XD
20:43 <@rafan> http://www.rafan.org/patch/big5/screen/files/patch-poorman-drawing
20:44 <@sunpoet> knight: 你是要寫在 screenrc 裡面自動開 big5/gbk 視窗嘛?
20:45 <@sunpoet> 最近的心得 PuTTY Treak CJK ambiguous characters as full 要選,screenrc 裡面加 defencoding utf8 , cjkwidth on
20:45 <@sunpoet> 編的時候要 WiTH_CJK
20:46 <@knight> sunpoet: y
20:46 <@knight> 那個我倒還沒這麼介意
20:47 <@sunpoet> knight: 請取用這個 patch, http://sunpoet.net/FreeBSD/screen-big5-gbk
20:47 <@knight> sunpoet: thx
20:47 <@rafan> 不是可以用 keybinding 設嗎?
20:48 <@sunpoet> knight: 然後在 screenrc 裡面的 screen 可以加 -b/-g 指定 big5/gbk
20:48 <@sunpoet> rafan: 那個還要手按,這個 patch 是可以直接在 screenrc 裡面指定
20:48 <@knight> !
20:48 <@sunpoet> rafan: 兩種不衝突啊,我都用了
20:48 <@knight> sunpoet: 這個就是我要的啊啊啊
20:49 <@sunpoet> knight: 因為我也需要,所以 ... :P
20:49 <@knight> 這個應該不限是在哪個版本吧
20:49 <@sunpoet> knight: 不限,我是拿 4.03 改的
20:50 <@sunpoet> 其實就只是做 encoding big5 utf8 的動作 :P
20:51 <@knight> y
20:56 <@mhsin_bsd> rafan: 喔我懂了,就跟 PuTTY 的 poorman's drawing 一樣 XD
20:59 <@rafan> mhsin_bsd: 不過 putty poorman's 我每次都用不成功 orz
--
2008/10/14 Updated: sunpoet 的 patch 換到 http://sunpoet.net/FreeBSD/screen-big5-gbk
Showing posts with label screen. Show all posts
Showing posts with label screen. Show all posts
2008-04-19
2007-12-09
你有 screen 時而不起的困擾嗎?看看這個吧
00:31 jnlin> puttytray真好用XD
00:34 yhchan> jnlin++
00:34 chinsan> jnlin: puttytray 我覺得不太好用 XD 若有內建 tab 的 putty 會比較好
00:35 jnlin> chinsan: tab!
00:35 jnlin> chinsan: 我是覺得有 screen 就很好用了 XD
00:37 chinsan> jnlin: screen 有時候 -r 或 -x (機率更高) 會當啊...到時候連的一大堆機器都要重來一次..
00:37 superd> 有的時候,還是得開二個 putty ><"
00:38 chinsan> wintabber 則是遇到不同大小的 putty 切換畫面時會怪怪的..
00:40 jnlin> chinsan: 我大概習慣當掉以後去重開了XD
00:41 gslin_csie> chinsan: 會當是因為另外一個 terminal 卡住了,給 sshd 一腳就好
00:43 chinsan> gslin_csie: 原來是這樣 @_@, 下次先試試看
00:43 * chinsan 都 -wipe
00:45 kcwu> 原來如此...
00:46 jnlin> gslin_csie: 有時候是 socket 不見了XD
00:46 gslin_csie> jnlin: 那就給他個 USR1?
00:46 gslin_csie> 還是 CONT?
00:47 yinjieh> 現在 socket 不見我都找一個 screen 裡面的 shell kill -9
00:47 yinjieh> 就回來了
00:48 gslin_csie> 都猜錯了,是 SIGCHLD...
00:48 gslin_csie> http://www4.informatik.uni-erlangen.de/~jnweiger/screen-faq.html
00:48 gslin_csie> "For some unknown reason, the fifo in /tmp/screens/S-myname is gone, and i can't resume my screen session. Is there a way to recreate the fifo?"
00:48 KN16H7> hmmm
00:49 jnlin> gslin_csie++
00:49 jnlin> 下次試試XD
00:49 gslin_csie> 我記得很久前本頻道有人講過啊
00:49 gslin_csie> yinjieh: 我記得明明就是你講的
00:50 chinsan> yinjieh: XD
00:50 yinjieh> gslin_csie: 是我找的沒錯啊 XD
所以解法就是送 SIGCHLD 給該 screen PID,那麼 screen 就會自動檢查 fifo/socket。比方該 screen PID 為 5566,那麼拯救 screen 的方是就是 kill -s CHLD 5566 或者 kill -20 5566 亦可。
另外,看不太懂上面那段 kill 是要幹嘛的,可以看看 kill(1) 指令有寫:
Some of the more commonly used signals:
1 HUP (hang up)
2 INT (interrupt)
3 QUIT (quit)
6 ABRT (abort)
9 KILL (non-catchable, non-ignorable kill)
14 ALRM (alarm clock)
15 TERM (software termination signal)
sigaction(2)有更詳細的解釋,
SIGCHLD discard signal child status has changed
或者參考 src/sys/sys/signal.h。
#define SIGCHLD 20 /* to parent on child stop or exit */
00:34 yhchan> jnlin++
00:34 chinsan> jnlin: puttytray 我覺得不太好用 XD 若有內建 tab 的 putty 會比較好
00:35 jnlin> chinsan: tab!
00:35 jnlin> chinsan: 我是覺得有 screen 就很好用了 XD
00:37 chinsan> jnlin: screen 有時候 -r 或 -x (機率更高) 會當啊...到時候連的一大堆機器都要重來一次..
00:37 superd> 有的時候,還是得開二個 putty ><"
00:38 chinsan> wintabber 則是遇到不同大小的 putty 切換畫面時會怪怪的..
00:40 jnlin> chinsan: 我大概習慣當掉以後去重開了XD
00:41 gslin_csie> chinsan: 會當是因為另外一個 terminal 卡住了,給 sshd 一腳就好
00:43 chinsan> gslin_csie: 原來是這樣 @_@, 下次先試試看
00:43 * chinsan 都 -wipe
00:45 kcwu> 原來如此...
00:46 jnlin> gslin_csie: 有時候是 socket 不見了XD
00:46 gslin_csie> jnlin: 那就給他個 USR1?
00:46 gslin_csie> 還是 CONT?
00:47 yinjieh> 現在 socket 不見我都找一個 screen 裡面的 shell kill -9
00:47 yinjieh> 就回來了
00:48 gslin_csie> 都猜錯了,是 SIGCHLD...
00:48 gslin_csie> http://www4.informatik.uni-erlangen.de/~jnweiger/screen-faq.html
00:48 gslin_csie> "For some unknown reason, the fifo in /tmp/screens/S-myname is gone, and i can't resume my screen session. Is there a way to recreate the fifo?"
00:48 KN16H7> hmmm
00:49 jnlin> gslin_csie++
00:49 jnlin> 下次試試XD
00:49 gslin_csie> 我記得很久前本頻道有人講過啊
00:49 gslin_csie> yinjieh: 我記得明明就是你講的
00:50 chinsan> yinjieh: XD
00:50 yinjieh> gslin_csie: 是我找的沒錯啊 XD
| Q: | For some unknown reason, the fifo in /tmp/screens/S-myname is gone, and i can't resume my screen session. Is there a way to recreate the fifo? |
|---|---|
| A: | Screen checks the fifo/socket whenever it receives a SIGCHLD signal. If missing, the fifo/socket is recreated then. If screen is running non set-uid the user can issue a 'kill -CHLD screenpid' directly (it is -CHILD on some systems). Screenpid is the process-id of the screen process found in a 'ps -x' listing. But usually this won't work, as screen should be installed setuid root. In this case you will not be able to send it a signal, but the kernel will. It does so, whenever a child of screen changes its state. Find the process-id (shellpid below) of the "least important" shell running inside screen. The try 'kill -STOP shellpid'. If the fifo/socket does not reappear, destroy the shell process. You sacrify one shell to save the rest. If nothing works, please do not forget to remove all processes running in the lost screen session. |
所以解法就是送 SIGCHLD 給該 screen PID,那麼 screen 就會自動檢查 fifo/socket。比方該 screen PID 為 5566,那麼拯救 screen 的方是就是 kill -s CHLD 5566 或者 kill -20 5566 亦可。
另外,看不太懂上面那段 kill 是要幹嘛的,可以看看 kill(1) 指令有寫:
Some of the more commonly used signals:
1 HUP (hang up)
2 INT (interrupt)
3 QUIT (quit)
6 ABRT (abort)
9 KILL (non-catchable, non-ignorable kill)
14 ALRM (alarm clock)
15 TERM (software termination signal)
sigaction(2)有更詳細的解釋,
SIGCHLD discard signal child status has changed
或者參考 src/sys/sys/signal.h。
#define SIGCHLD 20 /* to parent on child stop or exit */
Subscribe to:
Posts (Atom)