「St」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(en:stへの転送ページ)
 
(インストールリポジトリの変更)
(他の1人の利用者による、間の2版が非表示)
1行目: 1行目:
  +
{{Lowercase title}}
#redirect[[en:st]]
 
  +
[[Category:ターミナルエミュレータ]]
  +
[[en:St]]
  +
[http://st.suckless.org/ st] は [http://suckless.org suckless] による [[Xorg|X]] 向けのシンプルなターミナル実装です。[[xterm]] や [[urxvt]] を置き換える軽量なターミナルとして作られました。st は現在、256色、ほとんどの VT10X エスケープシーケンス、UTF-8、X11 コピー/ペースト、フォントのアンチエイリアス (fontconfig を使用)、フォールバックフォント、リサイズ、config.h によるショートカット、線画をサポートしています。
  +
  +
== インストール ==
  +
{{AUR|st}} または {{AUR|st-git}} パッケージを[[インストール]]してください。
  +
  +
== 設定 ==
  +
''st'' は {{ic|config.h}} ファイルで設定します。コンパイル時に {{ic|config.h}} からコピーされます。デフォルトの {{ic|config.def.h}} はソースに含まれています。
  +
  +
[[PKGBUILD]] と {{ic|config.h}} を自分でメンテナンスするようにしてください。
  +
  +
=== シェル ===
  +
  +
''st'' のデフォルトシェルを変更するには、以下の行を編集:
  +
  +
static char shell[] = "/bin/sh";
  +
  +
=== ターミナル ===
  +
  +
ターミナルのタイプを変更するには、以下の行を編集:
  +
  +
static char termname[] = "st-256color";
  +
  +
''st'' は {{ic|termname}} の値を {{ic|TERM}} 変数に設定します。
  +
  +
{{note|''st'' で問題が発生する場合、{{ic|termname}} を {{ic|xterm}} や {{ic|xterm-256color}} に設定してみてください。}}
  +
  +
=== フォント ===
  +
  +
以下の行を自由に編集してください:
  +
  +
static char font[] = "Liberation Mono:pixelsize=12:antialias=false:autohint=false";
  +
  +
コマンドラインでフォントの名前を指定することもできます:
  +
  +
$ st -f "Liberation Mono:size=12"
  +
  +
=== カラー ===
  +
  +
以下の行を編集することで''前景''・''背景''・''カーソル''の色を設定できます:
  +
  +
static unsigned int defaultfg = 7;
  +
static unsigned int defaultbg = 0;
  +
static unsigned int defaultcs = 256;
  +
  +
上記の値は同一ファイルの {{ic|*colorname[]}} 配列を参照します。デフォルトの色を使うことも {{ic|#rrggbb}} という形式で色を追加することもできます。例:
  +
  +
static const char *colorname[] = {
  +
/* 8 normal colors */
  +
"black",
  +
"red3",
  +
"green3",
  +
"yellow3",
  +
"blue2",
  +
"magenta3",
  +
"cyan3",
  +
"gray90",
  +
  +
/* 8 bright colors */
  +
"gray50",
  +
"red",
  +
"green",
  +
"yellow",
  +
"#5c5cff",
  +
"magenta",
  +
"cyan",
  +
"white",
  +
  +
[255] = 0,
  +
  +
/* more colors can be added after 255 to use with DefaultXX */
  +
"#cccccc",
  +
"#eeeeee",
  +
"#111111",
  +
};
  +
  +
/*
  +
* Default colors (colorname index)
  +
* foreground, background, cursor
  +
*/
  +
static unsigned int defaultfg = 257;
  +
static unsigned int defaultbg = 258;
  +
static unsigned int defaultcs = 256;
  +
  +
=== デスクトップエントリ ===
  +
以下のような[[デスクトップエントリ]]を作成することで、指定したフォントで ''st'' を簡単に起動できます (例: {{Pkg|adobe-source-code-pro-fonts}}):
  +
  +
{{hc|~/.local/share/applications/simple-terminal.desktop|2=
  +
[Desktop Entry]
  +
Name=Simple Terminal
  +
GenericName=Terminal
  +
Comment=standard terminal emulator for the X window system
  +
Exec=st -t "Suckless Terminal" -f "Source Code Pro:style=Semibold:size=12" -g "80x24"
  +
Terminal=false
  +
Type=Application
  +
Encoding=UTF-8
  +
Icon=terminal
  +
Categories=System;TerminalEmulator;
  +
Keywords=shell;prompt;command;commandline;cmd;
  +
}}
  +
  +
上記のメニューエントリはアプリケーションリストのシステムツールに ''Simple Terminal'' として表示されます。
  +
  +
== トラブルシューティング ==
  +
  +
==== アプリケーションによっては DEL キーが正しく機能しない ====
  +
以下の行を {{ic|~/.inputrc}} または {{ic|/etc/inputrc}} に追加してください:
  +
set enable-keypad on
  +
  +
==== ''vim'' のテキストの背景色が文字でない部分に表示されない ====
  +
{{ic|config.h}} の {{ic|termname}} を {{ic|st-256color}} に設定して再コンパイルしてみてください。シェルの中で {{ic|TERM}} 変数は設定しないでください。{{ic|st-256color}} に設定すると問題が発生します。
  +
  +
{{ic|.vimrc}} ファイルに以下の行を記述するという解決方法もあります:
  +
  +
if &term =~ '256color'
  +
" disable Background Color Erase (BCE) so that color schemes
  +
" render properly when inside 256-color tmux and GNU screen.
  +
" see also http://sunaku.github.io/vim-256color-bce.html
  +
set t_ut=
  +
endif
  +
  +
== 参照 ==
  +
*[http://st.suckless.org/ ホームページ]
  +
*[http://git.suckless.org/st/plain/FAQ よくある質問]
  +
*[http://git.suckless.org/st/ 公式 git リポジトリ]

2018年1月3日 (水) 12:51時点における版

stsuckless による X 向けのシンプルなターミナル実装です。xtermurxvt を置き換える軽量なターミナルとして作られました。st は現在、256色、ほとんどの VT10X エスケープシーケンス、UTF-8、X11 コピー/ペースト、フォントのアンチエイリアス (fontconfig を使用)、フォールバックフォント、リサイズ、config.h によるショートカット、線画をサポートしています。

インストール

stAUR または st-gitAUR パッケージをインストールしてください。

設定

stconfig.h ファイルで設定します。コンパイル時に config.h からコピーされます。デフォルトの config.def.h はソースに含まれています。

PKGBUILDconfig.h を自分でメンテナンスするようにしてください。

シェル

st のデフォルトシェルを変更するには、以下の行を編集:

static char shell[] = "/bin/sh";

ターミナル

ターミナルのタイプを変更するには、以下の行を編集:

static char termname[] = "st-256color";

sttermname の値を TERM 変数に設定します。

ノート: st で問題が発生する場合、termnamextermxterm-256color に設定してみてください。

フォント

以下の行を自由に編集してください:

static char font[] = "Liberation Mono:pixelsize=12:antialias=false:autohint=false";

コマンドラインでフォントの名前を指定することもできます:

$ st -f "Liberation Mono:size=12"

カラー

以下の行を編集することで前景背景カーソルの色を設定できます:

static unsigned int defaultfg = 7;
static unsigned int defaultbg = 0;
static unsigned int defaultcs = 256;

上記の値は同一ファイルの *colorname[] 配列を参照します。デフォルトの色を使うことも #rrggbb という形式で色を追加することもできます。例:

static const char *colorname[] = {
  	/* 8 normal colors */
      "black",
      "red3",
      "green3",
      "yellow3",
      "blue2",
      "magenta3",
      "cyan3",
      "gray90",

      /* 8 bright colors */
      "gray50",
      "red",
      "green",
      "yellow",
      "#5c5cff",
      "magenta",
      "cyan",
      "white",

      [255] = 0,

      /* more colors can be added after 255 to use with DefaultXX */
      "#cccccc",
      "#eeeeee",
      "#111111",
};

/*
 * Default colors (colorname index)
 * foreground, background, cursor
 */
static unsigned int defaultfg = 257;
static unsigned int defaultbg = 258;
static unsigned int defaultcs = 256;

デスクトップエントリ

以下のようなデスクトップエントリを作成することで、指定したフォントで st を簡単に起動できます (例: adobe-source-code-pro-fonts):

~/.local/share/applications/simple-terminal.desktop
[Desktop Entry]
Name=Simple Terminal
GenericName=Terminal
Comment=standard terminal emulator for the X window system
Exec=st -t "Suckless Terminal" -f "Source Code Pro:style=Semibold:size=12" -g "80x24"
Terminal=false
Type=Application
Encoding=UTF-8
Icon=terminal
Categories=System;TerminalEmulator;
Keywords=shell;prompt;command;commandline;cmd;

上記のメニューエントリはアプリケーションリストのシステムツールに Simple Terminal として表示されます。

トラブルシューティング

アプリケーションによっては DEL キーが正しく機能しない

以下の行を ~/.inputrc または /etc/inputrc に追加してください:

set enable-keypad on

vim のテキストの背景色が文字でない部分に表示されない

config.htermnamest-256color に設定して再コンパイルしてみてください。シェルの中で TERM 変数は設定しないでください。st-256color に設定すると問題が発生します。

.vimrc ファイルに以下の行を記述するという解決方法もあります:

if &term =~ '256color'
    " disable Background Color Erase (BCE) so that color schemes
    " render properly when inside 256-color tmux and GNU screen.
    " see also http://sunaku.github.io/vim-256color-bce.html
    set t_ut=
endif

参照