Develop and Download Open Source Software

Browse Subversion Repository

Annotation of /branches/ttcomtester/tests/unicodebuf-irm3.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8445 - (hide annotations) (download) (as text)
Tue Dec 17 12:15:31 2019 UTC (4 years, 3 months ago) by doda
Original Path: trunk/tests/unicodebuf-irm3.sh
File MIME type: text/x-sh
File size: 916 byte(s)
Merge branch 'unicode_buf'
1 doda 8445 #!/bin/sh
2    
3     CSI() {
4     printf "\033[%s" "$1"
5     }
6    
7     InitScreen() {
8     CSI "8;24;20t" # 端末サイズを 20x24 に変更
9     CSI "2J" # 画面消去
10     CSI "1;1H" # カーソルを画面左上に移動
11     }
12    
13     InitScreen
14    
15     # 文字色を赤(色番号1)にする
16     # 出力 "12345678901234567890"
17     # 出力 "123456789012345678あ"
18     # 文字属性を解除(色を戻す)
19     # 挿入モード設定
20     # 左へ5
21     # 出力 "a"
22     # 挿入モード解除
23    
24     # 半角1文字
25     printf "test 1\n"
26     printf "\e[31m12345678901234567890\e[m\e[4h\e[5Da\e[4l\n"
27     printf "expect\n"
28     printf "\e[31m12345678901234\e[ma\e[31m56789\e[m\n"
29    
30     # 全角1文字
31     printf "test 2\n"
32     printf "\e[31m12345678901234567890\e[m\e[4h\e[5Dあ\e[4l\n"
33     printf "expect\n"
34     printf "\e[31m12345678901234\e[mあ\e[31m5678\e[m\n"
35    
36     # 行末に全角
37     printf "test 3\n"
38     printf "\e[31m123456789012345678あ\e[m\e[4h\e[5Da\e[4l\n"
39     printf "expect\n"
40     printf "\e[31m12345678901234\e[ma\e[31m5678 \e[m\n"

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26