「Rxvt-unicode」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(他言語へのリンクを修正)
 
(5人の利用者による、間の31版が非表示)
1行目: 1行目:
[[Category:ターミナルエミュレータ]]
 
 
{{DISPLAYTITLE:rxvt-unicode}}
 
{{DISPLAYTITLE:rxvt-unicode}}
  +
[[Category:ターミナルエミュレータ]]
 
[[de:urxvt]]
 
[[de:urxvt]]
 
[[en:Rxvt-unicode]]
 
[[en:Rxvt-unicode]]
[[es:Rxvt-unicode]]
+
[[ru:Rxvt-unicode]]
[[fr:urxvt]]
+
[[zh-hans:Rxvt-unicode]]
  +
{{Related articles start}}
[[sr:Rxvt-unicode]]
 
  +
{{Related|rxvt-unicode/ヒントとテクニック}}
[http://software.schmorp.de/pkg/rxvt-unicode.html rxvt-unicode] は細かいカスタマイズができる[[Wikipedia:ja:端末エミュレータ|ターミナルエミュレータ]]で [[Wikipedia:ja:Rxvt|rxvt]] のフォークです。一般に {{Ic|urxvt}} と呼ばれている、rxvt-unicode は[[デーモン]]化して一つの[[Wikipedia:ja:プロセス|プロセス]]で複数のクライアントを実行することができ、システムリソースの使用を抑えることができます。Marc Lehmann によって開発されており、rxvt-unicode の取り柄としては [[Wikipedia:ja:Unicode|Unicode]] による多言語サポートや、複数のフォントタイプの表示機能、[[Wikipedia:ja:Perl|Perl]] 拡張のサポートなどが挙げられます。
 
  +
{{Related articles end}}
  +
[http://software.schmorp.de/pkg/rxvt-unicode.html rxvt-unicode] は細かいカスタマイズができるターミナルエミュレータで [[Wikipedia:ja:Rxvt|rxvt]] のフォークです。rxvt-unicode の取り柄としては [[Wikipedia:ja:Unicode|Unicode]] による多言語サポートや、透過、複数のフォントタイプの表示機能、[[Perl]] 拡張のサポートなどが挙げられます。
   
 
== インストール ==
 
== インストール ==
   
{{Pkg|rxvt-unicode}} は[[公式リポトリ]]からインストールすることができ、256色のカラーをサポートしています。
+
{{Pkg|rxvt-unicode}} パッケーインストールすることができます。
 
また、[[AUR]] からは {{AUR|rxvt-unicode-patched}} をインストールでき、フォントの太さに関するバグが修正されています。
 
   
 
== 設定 ==
 
== 設定 ==
   
設定と値の完全なリストは [http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.1.pod rxvt-unicode リファレンスページ] を見て下さい。
+
設定と値の完全なリストは {{man|1|urxvt}} {{man|7|urxvt}} を見て下さい。
   
=== ~/.Xresources の作成 ===
+
=== Xresources ===
   
rxvt-unicode の外観や機能はコマンドラインの引数や [[X resources]] によって制御されます。X resources は {{ic|~/.Xresources}} や xrdb ({{Pkg|xorg-xrdb}}) を使って設定することができます。詳しくは [[en2:X resources|wiki ページ]]を見
+
rxvt-unicode の外観や機能はコマンドラインの引数や [[X resources]] によって制御されます。コマンドライン引数は [[X resources]] の設定よりも優先し適用れます
   
  +
{{ic|urxvt --help}} は全ての ''rxvt'' リソースを標準エラーに出力します。各リソースの説明は man ページに存在します。
Append commented list of all rxvt resources to your {{ic|~/.Xresources}} file
 
   
  +
=== スクロールバックの位置 ===
urxvt --help 2>&1| sed -n '/: /s/^ */! URxvt*/gp' >> ~/.Xresources
 
   
  +
デフォルトでは、シェル出力が更新されると、スクロールバックの表示は自動的にバッファの最後にジャンプし、新しい出力を表示します。前の出力 (コンパイラメッセージなど) を表示したい場合は {{ic|~/.Xresources}} に以下のオプションを設定します:
Or for a commented list + helpful descriptions
 
 
{{bc|<nowiki>TERM=rxvt-unicode-256color command man -Pcat urxvt | sed -n '/depth: b/,/^BA/p'|sed '$d'|sed '/^ [a-z]/s/^ */^/g'|sed -e :a -e 'N;s/\n/@@/g;ta;P;D'|sed 's,\^\([^@]\+\)@*[\t ]*\([^\^]\+\),! \2\n! URxvt*\1\n\n,g'|sed 's,@@\( \+\),\n\1,g'|sed 's,@*$,,g'|sed '/^[^!]/d'|tr -d "'\`" >> ~/.Xresources</nowiki>}}
 
 
{{Note|Command-line arguments override, and take precedence over resource settings}}
 
 
=== 完全透過 ===
 
 
完全透過を使用するには、コンポジタによるコンポジットをサポートしている[[ウィンドウマネージャ]]を使っている必要があります。
 
 
コマンドラインから:
 
 
$ urxvt -depth 32 -bg rgba:3f00/3f00/3f00/dddd
 
 
設定ファイルを使用:
 
 
{{hc|~/.Xresources|
 
URxvt.depth: 32
 
URxvt.background: rgba:1111/1111/1111/dddd
 
}}
 
 
or
 
 
{{hc|~/.Xresources|
 
URxvt.depth: 32
 
URxvt.background: [95]#000000
 
}}
 
 
'95' は透過レベル (パーセンテージ)、'#000000' は背景色に置き換えて下さい。
 
 
To use a color i.e. #302351 with the rgba:rrrr/gggg/bbbb/aaaa syntax it would be rgba:3000/2300/5100/ee00. "ee00" (the alpha value) to make it nicely transparent.
 
 
{{Note|To make these settings universal for all forms of URxvt, you may add a wildcard. For example, {{ic|URxvt.depth}} would become {{ic|URxvt*.depth}}.}}
 
 
=== 擬似透過 ===
 
 
完全透過の必要がない場合、もしくはコンポジットによるシステムリソースの消費が多すぎるという場合、以下のようにして透過を使うことができます:
 
 
{{hc|~/.Xresources|<nowiki>
 
! Xresources file
 
 
URxvt*.transparent: true
 
! URxvt*.shading: 0 to 99 darkens, 101 to 200 lightens
 
URxvt*.shading: 110
 
</nowiki>}}
 
 
Using the URxvt*background setting exemplified above instead of URxvt*.shading will also work.
 
 
{{Note|Avoid using shading if you have a {{ic|URxvt.tintColor}} set. Use a different {{ic|tintColor}} instead.}}
 
 
=== スクロールバー ===
 
 
The look of the scrollbar can be chosen through this entry in {{ic|~/.Xresources}}:
 
 
! scrollbar style - rxvt (default), plain (most compact), next, or xterm
 
URxvt.scrollstyle: rxvt
 
 
The scrollbar can also be completely deactivated like so:
 
 
URxvt.scrollBar: false
 
 
=== Scrollback position ===
 
 
By default, when shell output appears the scrollback view will automatically jump to the bottom of the buffer to display new output. If in cases where you want to see previous output (e.g., compiler messages), set the following options in {{ic|~/.Xresources}}:
 
   
 
! do not scroll with output
 
! do not scroll with output
100行目: 37行目:
 
URxvt*scrollTtyKeypress: true
 
URxvt*scrollTtyKeypress: true
   
  +
=== セカンダリスクリーンのスクロールバッファ ===
=== Scrollback buffer in secondary screen ===
 
  +
  +
''セカンダリスクリーン'' でページャをスクロールすると (例えば {{ic|less}} で {{ic|'''-X'''}} オプションを省略した場合)、端末のバッファではなくページャ内でスクロールできるようスクロールバックバッファを無効にすることをお勧めします。konsole および vte ベースの端末ではデフォルトでこういう仕様になっており動作を変更できません。urxvt で ''セカンダリスクリーン''のスクロールバックバッファを無効にするには:
   
When you scroll a pager in a ''secondary screen''(e.g. {{ic|less}} without the {{ic|'''-X'''}} option), it may be a good idea to disable the scrollback buffer to be able to scroll in the pager ''itself'', instead of the terminal's buffer: this is default and unchangeable behaviour in konsole and vte-based terminals.
 
In urxvt, to disable the scrollback buffer for the ''secondary screen'':
 
 
URxvt.secondaryScreen: 1
 
URxvt.secondaryScreen: 1
 
URxvt.secondaryScroll: 0
 
URxvt.secondaryScroll: 0
   
  +
上記の設定は、マウスホイールを使用してスクロールする場合を除いて、期待通りに機能します。マウスホイールでセカンダリスクリーンのページャをスクロールしたとき、スクロールバックバッファに何かがあると、ページャの代わりにスクロールバックバッファがマウスホイールでスクロールされます。この問題を解決するには、rxvt-unicode に新しいオプションを導入する必要があります [https://bbs.archlinux.org/viewtopic.php?id=132150] AUR の {{aur|rxvt-unicode-better-wheel-scrolling}} でパッチが適用された rxvt-unicode が利用できます。パッケージのインストール後、以下を設定ファイルに追加してください:
The above configuration works as expected except when scrolling with a mouse wheel. When you scroll a pager in the ''secondary screen'' with the mouse wheel - and there has been something in the scrollback buffer, instead of the pager itself - the scrollback buffer will be scrolled by the mouse wheel. To solve this issue, it is necessary to introduce a new option into rxvt-unicode[https://bbs.archlinux.org/viewtopic.php?id=132150]. A patched rxvt-unicode is available in AUR as {{aur|rxvt-unicode-better-wheel-scrolling}}. After installing it, add the following to the configuration file:
 
  +
 
URxvt.secondaryWheel: 1
 
URxvt.secondaryWheel: 1
   
  +
{{Note|perl 拡張の {{AUR|urxvt-vtwheel}} は上記のオプションと衝突します。}}
{{note|Please do not use this option with the [[#Scrollwheel_support|vtwheel]] perl extension, it will mess up.}}
 
   
  +
=== フォントを宣言する方法 ===
=== Font declaration methods ===
 
   
 
URxvt.font: 9x15
 
URxvt.font: 9x15
  +
上記の設定は以下と同じです:
is the same as:
 
 
URxvt.font: -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-1
 
URxvt.font: -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-1
  +
同じフォントを太字で使用するには:
 
And, for the same font in bold:
 
 
URxvt.font: 9x15bold
 
URxvt.font: 9x15bold
  +
上記の設定は以下と同じです:
is the same as:
 
 
URxvt.font: -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-1
 
URxvt.font: -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-1
   
  +
X コアフォントの短縮名の完全なリストは {{ic|/usr/share/fonts/misc/fonts.alias}} にあります ({{ic|/usr/share/fonts/}} のサブディレクトリにも fonts.alias ファイルが存在しますが、実際のフォントとは別のパッケージになっているため、インストールされていないフォントも含まれます)。フォントの短縮エイリアスは ISO-10646-1 (Unicode) バージョンではなく ISO-8859-1 バージョンを選択し、100 DPI バージョンではなく 75 DPI バージョンのフォントが使われるため、フォントを選択したいときは長い方の名前を使ってください。
The complete list of short names for X core fonts can be found in {{ic|/usr/share/fonts/misc/fonts.alias}} (there's also some fonts.alias files in some of the other subdirectories of {{ic|/usr/share/fonts/}}, but as they are packaged separately from the actual fonts, they may list fonts you do not actually have installed). It is worth noting that these short aliases select for ISO-8859-1 versions of the fonts rather than ISO-10646-1 (Unicode) versions, and 75 DPI rather than 100 DPI versions, so you're probably better off avoiding them and choosing fonts by their full long names instead.
 
   
  +
上記はビットマップフォントの話で、他のフォントは以下のように Xft で使うことができます:
{{Note|The above paragraph is only for bitmap fonts. Other fonts can be used through Xft using the following format:}}
 
 
URxvt.font: xft:monaco:size=10
 
URxvt.font: xft:monaco:size=10
   
  +
または:
Or
 
 
URxvt.font: xft:monaco:bold:size=10
 
URxvt.font: xft:monaco:bold:size=10
   
  +
{{Note|Xft のフォント名にハイフン (-) が含まれている場合は、バックスラッシュ (\) を2回打ってエスケープしてください。バックスラッシュ1回でエスケープする urxvt の -fn オプションや fc-list の出力とは仕方が異なります。}}
{{Note|If there is a hyphen(-) in an Xft font name, it must be escaped with backslash(\) twice. It's different from the usage of urxvt -fn option and the result that fc-list returns, where backslash present only once}}
 
   
  +
以下のようにターミナルにエスケープコードを出力することで一時的にフォントをテストすることが可能です:
=== アイコンの設定 ===
 
  +
$ printf '\e]710;%s\007' "xft:Terminus:pixelsize=12"
   
  +
=== フォントの間隔 ===
{{Note|Because of a bug report[https://bugs.archlinux.org/task/34862] complaining that the rxvt-unicode package had too many dependencies, you must now install the AUR package {{AUR|rxvt-unicode-pixbuf}} in order to use the icon option.}}
 
   
  +
デフォルトでは文字の間隔が広すぎるように感じられる場合、以下のエントリで調整できます:
By default URxvt does not feature a taskbar icon. However, this can be easily changed by adding the following line to {{ic|~/.Xresources}} and pointing to the desired icon:
 
   
  +
{{hc|~/.Xresources|<nowiki>
URxvt.iconFile: /usr/share/icons/Clarity/scalable/apps/terminal.svg
 
  +
URxvt.letterSpace: -1
  +
</nowiki>}}
   
  +
{{ic|-1}} で1ピクセル文字の間隔が狭まります。必要ならばもっと狭めることもできます。
=== ログインシェルに設定 ===
 
   
  +
=== カラー ===
This will cause the shell to be started as a login shell, like the option {{ic|-ls}}.
 
URxvt*loginShell: true
 
   
  +
デフォルトで、rxvt-unicode はカラーサポートを有効にしてコンパイルされています。デフォルトの前景色・背景色に加えて、rxvt は256色まで表示することができます (太字・点滅・下線とそれらの組み合わせも可能です)
=== urxvt をアプリケーションランチャーとして使う ===
 
   
  +
foreground, background, cursorColor, cursorColor2, colorBD, colorUL は0から15の数字で色を指定することができ、短い名前で color0-color15 の色を使うことができます。詳しくは [[#Xresources]] を参照。
urxvt can be used as a lightweight alternative to application launchers such as {{pkg|gmrun}}. Run urxvt with the following configuration to imitate look and behaviour of an application launcher or assign the command to a custom alias:
 
   
  +
{{Note|デフォルトでは {{ic|urxvt}} は [[Xterm]] と同じ色を使用しますが、ひとつだけ違う色があります。変更するには Xresources に {{ic|URxvt.color12: rgb:5c/5c/ff}} を追加してください。}}
$ urxvt -geometry 80x3 -name 'bashrun' -e sh -c "/bin/bash -i -t"
 
   
=== Font spacing ===
+
=== 印刷 ===
   
  +
デフォルトで、rxvt-unicode は {{ic|PrintScreen}} が押されたときに lpr でスクリーンキャプチャをプリントします。{{ic|Ctrl+PrintScreen}} または {{ic|Shift-PrintScreen}} を使うとターミナルのスクロールバックも印刷されます。設定によって挙動を変更したり無効化することが可能です。
By default the distance between characters can feel too wide. It's controlled by this entry:
 
   
 
{{hc|~/.Xresources|<nowiki>
 
{{hc|~/.Xresources|<nowiki>
  +
! Disable printing the terminal contents when pressing PrintScreen.
URxvt.letterSpace: -1
 
  +
URxvt.print-pipe: "cat > /dev/null"
 
</nowiki>}}
 
</nowiki>}}
   
  +
=== 設定をリロードする ===
Here {{ic|-1}} decreases the spacing by one pixel, but can be adjusted as needed.
 
  +
  +
設定を変更した後、{{Ic|xrdb ~/.Xresources}} を実行して、設定をリロードします。新しい設定は全ての新しい端末に適用されます。
  +
  +
== カットアンドペースト ==
  +
  +
Rxvt-unicode はデフォルトで {{Ic|PRIMARY}} セレクションにロードされているカットバッファを使います。詳しくは [http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.1.pod#THE_SELECTION_SELECTING_AND_PASTING_ Selecting and pasting text] を見てください。
  +
  +
{{ic|ALT-CTRL-c}} と {{ic|ALT-CTRL-v}} でコピーアンドペーストができます。
  +
  +
{{Note|選択したテキストは自動的に {{ic|PRIMARY}} にコピーされます。{{Pkg|rxvt-unicode}} 9.20 から [[#Perl 拡張|perl 拡張]] の {{ic|selection-to-clipboard}} を使うことでテキストを {{ic|CLIPBOARD}} にコピーできます。}}
  +
  +
選択した内容を {{ic|PRIMARY}} にコピーし、{{ic|CLIPBOARD}} が選択した内容で更新されていることを確認するには、次を追加します。
  +
  +
URxvt.perl-ext-common: ...,clipboard,...
  +
  +
以下を追加
  +
  +
URxvt.clipboard.autocopy: true
  +
URxvt.keysym.M-c: perl:clipboard:copy
  +
URxvt.keysym.M-v: perl:clipboard:paste
  +
  +
[[クリップボード#クリップボードマネージャの一覧]]も参照。
   
 
== Perl 拡張 ==
 
== Perl 拡張 ==
  +
  +
次の行を含めることで、URxvt perl 拡張機能を有効にできます。
  +
  +
URxvt.perl-ext-common: extension_name_1,extension_name_2,...
  +
  +
拡張子名の間にスペースを '''入れないように''' 注意してください。
   
 
=== クリックできる URL ===
 
=== クリックできる URL ===
   
  +
matcher 拡張を使うことでターミナルに表示された URL をクリックできるようになります。例えば、(規定のウェブブラウザを使って) 左マウスボタンでリンクを開くには、以下を {{ic|.Xresources}} に追加します:
You can make URLs in the terminal clickable using the matcher extension. For example, to open links in [[Firefox]] add the following to {{ic|.Xresources}}:
 
   
 
URxvt.perl-ext-common: default,matcher
 
URxvt.perl-ext-common: default,matcher
URxvt.url-launcher: /usr/bin/firefox
+
URxvt.url-launcher: /usr/bin/xdg-open
 
URxvt.matcher.button: 1
 
URxvt.matcher.button: 1
   
  +
rxvt-unicode 9.14 から、キーボードを使って最近閲覧した URL を開いたり確認することもできるようになりました:
Since rxvt-unicode 9.14, it's also possible to use matcher to open and list recent (currently limited to 10) URLs via keyboard:
 
   
 
URxvt.keysym.C-Delete: perl:matcher:last
 
URxvt.keysym.C-Delete: perl:matcher:last
 
URxvt.keysym.M-Delete: perl:matcher:list
 
URxvt.keysym.M-Delete: perl:matcher:list
   
  +
マッチするリンクに前景色・背景色といった[[#カラー|色]]を付けることもできます。例えば青色なら以下のようになります:
To color all matching text in a blue color for quickly finding links, use the following setting or any color in the form of #RRGGBB you like instead.
 
  +
  +
URxvt.matcher.rend.0: Uline Bold fg5
  +
  +
他には、{{ic|colorUL}} を使えば #RRGGBB スタイルでの色付けができます。ただし、これはリンクにマッチした部分だけでなく下線付きテキストのすべてに適用されます:
   
 
URxvt.colorUL: #4682B4
 
URxvt.colorUL: #4682B4
   
=== ヤンクできる URL (no mouse) ===
+
=== ヤンクできる URL (マウスを使用しない) ===
   
  +
また、マウスを使わずに選択した URL をブラウザで開くこともできます。
In addition, you can select and open URLs in your web browser without using the mouse.
 
   
Install the {{Pkg|urxvt-perls}} package from the [[official repositories]] and adjust your {{ic|.Xresources}} as necessary. An example is shown below:
+
{{Pkg|urxvt-perls}} パッケージをインストールして適当に {{ic|.Xresources}} を調整してください。例:
 
URxvt.perl-ext: default,url-select
 
URxvt.perl-ext: default,url-select
 
URxvt.keysym.M-u: perl:url-select:select_next
 
URxvt.keysym.M-u: perl:url-select:select_next
191行目: 163行目:
 
URxvt.url-select.underline: true
 
URxvt.url-select.underline: true
   
{{Note|This extension replaces the Clickable URLs extension mentioned above, so {{Ic|matcher}} can be removed from the {{Ic|URxvt.perl-ext}} list.}}
+
{{Note|この拡張は、上で説明したクリックできる URL拡張を置き換えるため、{{Ic|matcher}} {{Ic|URxvt.perl-ext}} のリストから除外してください。}}
   
'''Key commands:'''
+
'''キーコマンド:'''
{{Tip|To change {{ic|Alt+u}} to a more intuitive {{ic|Ctrl+i}}, replace {{ic|M-u}} by {{ic|C-i}} above.}}
 
   
 
{| class="wikitable"
 
{| class="wikitable"
! Key !! Description
+
! キー !! 説明
 
|-
 
|-
  +
| Alt+u || 選択モードに移行。スクリーン上にある最後のURLが選択されます。{{ic|Alt+u}} を繰り返せば更に上にある URL を選択できます。
| Alt+u || Enter selection mode. The last URL on your screen will be selected. You can repeat {{ic|Alt+u}} to select the next upward URL.
 
 
|-
 
|-
| k || Select next upward URL
+
| k || 上にある URL を選択
 
|-
 
|-
| j || Select next downward URL
+
| j || 下にある URL を選択
 
|-
 
|-
  +
| Return || 選択モードを終了して選択した URL をブラウザで開く
| Return || Open selected URL in browser and quit selection mode
 
 
|-
 
|-
  +
| o || 選択モードを終了せずに選択した URL をブラウザで開く
| o || Open selected URL in browser without quitting selection mode
 
 
|-
 
|-
  +
| y || 選択モードを終了して選択した URL をコピーする
| y || Copy (yank) selected URL and quit selection mode
 
 
|-
 
|-
| Esc || Cancel URL selection mode
+
| Esc || URL 選択モードをキャンセル。
 
|}
 
|}
   
243行目: 214行目:
 
URxvt.tabbed.tab-fg: 3
 
URxvt.tabbed.tab-fg: 3
 
URxvt.tabbed.tab-bg: 0
 
URxvt.tabbed.tab-bg: 0
 
=== 高度なタブの管理 ===
 
 
Install the {{AUR|urxvt-tabbedex}} package from [[AUR]], then add the {{ic|tabbedex}} value to the {{ic|URxvt.perl-ext-common}} X resource in your {{ic|~/.Xresources}}:
 
URxvt.perl-ext-common: ...,tabbedex,...
 
 
{{Note|If you have previously used the {{ic|tabbed}} Perl extension and have defined the {{ic|tabbed}} value for the {{ic|URxvt.perl-ext-common}} X resource, please remove the {{ic|tabbed}} value first to avoid conflict with {{ic|tabbedex}}.}}
 
 
By default, the "[NEW]" button (which is rarely used and usable only with the mouse) is disabled with tabbedex. You can reenable this feature by setting the {{ic|new-button}} to yes.
 
URxvt.tabbed.new-button: true
 
 
Tabs can be named with {{ic|Shift+ ↑}} ({{ic|Enter}} to confirm, {{ic|Escape}} to cancel).
 
 
To automatically hide the tabs bar when only one tab is present, enable the following resource:
 
URxvt.tabbed.autohide: true
 
 
To prevent the last tab from closing Urxvt, enable the following resource:
 
URXvt.tabbed.reopen-on-close: yes
 
 
To start a new tab or cycle through tabs, use the following user commands: {{ic|<nowiki>tabbedex:(new|next|prev)_tab</nowiki>}}. Example of mappings:
 
URxvt.keysym.Control-t: perl:tabbedex:new_tab
 
URxvt.keysym.Control-Tab: perl:tabbedex:next_tab
 
URxvt.keysym.Control-Shift-Tab: perl:tabbedex:prev_tab
 
 
To define your own key bindings to rename a tab or move a tab to the right or to the left, use the following commands: {{ic|<nowiki>tabbedex:move_tab_(left|right)</nowiki>}} and {{ic|tabbedex:rename_tab}}. Example of mappings:
 
URxvt.keysym.Control-Shift-Left: perl:tabbedex:move_tab_left
 
URxvt.keysym.Control-Shift-Right: perl:tabbedex:move_tab_right
 
URxvt.keysym.Control-Shift-R: perl:tabbedex:rename_tab
 
 
{{Note|Redefining the keys used for the user commands will not disable the default mappings, you have to set the X resource {{ic|no-tabbedex-keys}} for that:
 
URxvt.tabbed.no-tabbedex-keys: true
 
}}
 
   
 
=== フルスクリーン ===
 
=== フルスクリーン ===
   
  +
{{AUR|urxvt-fullscreen}} パッケージをインストールして、urxvt をフルスクリーンにするキーバインディングを設定することができます:
You can install the [[AUR]] package {{AUR|urxvt-fullscreen}}, and then set a key binding to put urxvt fullscreen.
 
   
 
{{hc|~/.Xresources|
 
{{hc|~/.Xresources|
287行目: 226行目:
 
}}
 
}}
   
  +
=== フォントサイズを即座に変更 ===
=== スクロールホイールのサポート ===
 
   
Install {{AUR|urxvt-vtwheel}} from the [[AUR]] and add it to your Perl extensions within {{ic|~/.Xresources}}:
+
{{AUR|urxvt-resize-font-git}} パッケージをインストールして {{ic|~/.Xresources}} の Perl 拡張に以下を追加してください:
   
URxvt.perl-ext-common: ...,vtwheel,...
+
URxvt.perl-ext-common: ...,resize-font,...
   
=== フォズを即座に変更 ===
+
フォのキーバンド:
  +
* {{ic|Ctrl++}} (または {{ic|1=Ctrl+Shift+=}}) でサイズを大きくする
  +
* {{ic|Ctrl+-}} でサイズを小さくする
  +
* {{ic|1=Ctrl+=}} でサイズをリセットする
  +
* {{ic|Ctrl+?}} で現在のサイズを表示
   
  +
以下のようにキーバインドを変更することもできます:
Install {{AUR|urxvt-font-size-git}} from the [[AUR]], add it to your Perl extensions within {{ic|~/.Xresources}}
 
   
URxvt.perl-ext-common: ...,font-size,...
+
URxvt.keysym.C-Down: resize-font:smaller
  +
URxvt.keysym.C-Up: resize-font:bigger
   
  +
キーバインドとして Ctrl+Shift を使うなら、デフォルトのキーバインドを無効化しておく必要があります ([http://wilmer.gaa.st/blog/archives/36-rxvt-unicode-and-ISO-14755-mode.html 詳細]):
and add some key bindings, for example like this:
 
   
  +
URxvt.iso14755: false
URxvt.keysym.C-Up: perl:font-size:increase
 
  +
URxvt.iso14755_52: false
URxvt.keysym.C-Down: perl:font-size:decrease
 
URxvt.keysym.C-S-Up: perl:font-size:incglobal
 
URxvt.keysym.C-S-Down: perl:font-size:decglobal
 
 
For the suggested Ctrl+Shift bindings to work, a default binding needs to be disabled (see discussion [http://wilmer.gaa.st/blog/archives/36-rxvt-unicode-and-ISO-14755-mode.html here]):
 
 
URxvt.iso14755: false
 
URxvt.iso14755_52: false
 
   
 
=== Perl 拡張の無効化 ===
 
=== Perl 拡張の無効化 ===
   
  +
Perl 拡張機能を使っていない場合、完全に Perl 拡張を無効化することでセキュリティと性能を高めることができます:
If you do not use the Perl extension features, you can improve the security and speed by disabling Perl extensions completely.
 
 
URxvt.perl-ext:
 
URxvt.perl-ext:
 
URxvt.perl-ext-common:
 
URxvt.perl-ext-common:
   
  +
{{Note|複数の Perl 拡張を使うなら、次のようにカンマ区切りに並べて記述することができます: {{ic|URxvt.perl-ext-common:default,matcher,tabbed}}}}
== カラー ==
 
   
  +
=== インプットメソッドのインライン表示 ===
By default, rxvt-unicode is compiled with color support. In addition to the default foreground and background colors, rxvt can display up to 256 colors (plus high-intensity bold/blinking/underlined and any mix of these).
 
  +
urxvt でインプットメソッドをインライン表示にする場合は、以下を {{ic|~/.Xresources}} に追加します:
The look, feel, and function of rxvt-unicode is controlled by command-line arguments called X resources.
 
  +
URxvt.perl-ext-common: ...,xim-onthespot,...
   
  +
インプットメソッドの指定とプレエディットタイプの設定も必要になります (''fcitx'' の部分は自分が使用しているインプットメソッドに変更する必要があります):
A sample ~/.Xresoures with for a urxvt terminal with default colors but white fonts on a black background would be written as follow:
 
  +
URxvt.inputMethod: fcitx
 
  +
URxvt.preeditType: OnTheSpot
{{hc|~/.Xresources|2=
 
! Background color
 
URxvt*background: black
 
 
! Font color
 
URxvt*foreground: white
 
 
! Other colors
 
URxvt*color0: black
 
URxvt*color1: red3
 
URxvt*color2: green3
 
URxvt*color3: yellow3
 
URxvt*color4: blue2
 
URxvt*color5: magenta3
 
URxvt*color6: cyan3
 
URxvt*color7: gray90
 
URxvt*color8: grey50
 
URxvt*color9: red
 
URxvt*color10: green
 
URxvt*color11: yellow
 
URxvt*color12: blue
 
URxvt*color13: magenta
 
URxvt*color14: cyan
 
URxvt*color15: white
 
}}
 
 
It is also possible to specify the color values of foreground, background, cursorColor, cursorColor2, colorBD, colorUL as a number 0-15, as a convenient shorthand to reference the color name of color0-color15. See [[#Creating ~/.Xresources|Creating ~/.Xresources]] to create a commented {{ic|~/.Xresources}} file for {{ic|urxvt}}
 
 
==== Xterm のようなカラー ====
 
 
By default {{ic|urxvt}} uses the same colors as {{ic|xterm}} use except one. Add the following line at the end of your {{ic|~/.Xresources}} for xterm-like colors:
 
{{hc|~/.Xresources|2=
 
...
 
URxvt*color12: rgb:5c/5c/ff
 
}}
 
then merge it contents with your current X resources configuration with:
 
xrdb -merge ~/.Xresources
 
and finally restart {{ic|urxvt}}.
 
 
== パフォーマンスの改善 ==
 
 
* Avoid the use of Xft fonts. If Xft fonts must be used, append {{Ic|<nowiki>:antialias=false</nowiki>}} to the setting value.[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod#Can_I_speed_up_Xft_rendering_somehow]
 
* Build rxvt-unicode with disabled support for unnecessary features, {{Ic|--disable-xft}} and {{Ic|--disable-unicode3}} in particular.<sup>[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod#Rxvt_unicode_uses_gobs_of_memory_how]
 
* Limit the number of {{Ic|saveLines}} (option {{Ic|-sl}}) in the scrollback buffer to reduce memory usage. [http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod#Isn_t_rxvt_unicode_supposed_to_be_sm]
 
** Use tmux for scrollback buffer and set saveLines to 0
 
* [[#Disabling Perl extensions|Disable perl]]
 
* Consider running {{Ic|urxvtd}} as a daemon accepting connections from {{Ic|urxvtc}} clients.
 
 
=== デーモンクライアント ===
 
 
==== Xinitrc ====
 
 
See the ''Examples'' section in {{ic|man urxvtd}}.
 
 
==== systemd ====
 
 
{{Note|systemd で起動した urxvt クライアント/デーモンにログインしているとき、通常ユーザーは systemctl の電源コマンド (reboot, poweroff など) を実行することはできません。クライアントが[[セッション]]に含まれなくなるからです。}}
 
 
システムサービス:
 
 
{{hc|/etc/systemd/system/urxvtd@.service|<nowiki>
 
[Unit]
 
Description=RXVT-Unicode Daemon
 
 
[Service]
 
User=%i
 
ExecStart=/usr/bin/urxvtd -q -o
 
 
[Install]
 
WantedBy=multi-user.target
 
</nowiki>}}
 
 
Pass the username when [[Systemd#Units|starting the service]]:
 
 
urxvtd@''username''.service
 
 
[[systemd/ユーザー]]サービスの場合、以下のユニットファイルを {{ic|~/.config/systemd/user}} に配置してください:
 
 
{{hc|urxvtd.service|<nowiki>
 
[Unit]
 
Description=Urxvt Terminal Daemon
 
Requires=urxvtd.socket
 
 
[Service]
 
ExecStart=/usr/bin/urxvtd -o -q
 
Environment=RXVT_SOCKET=%t/urxvtd-%H
 
 
[Install]
 
WantedBy=</nowiki>''MyTarget''.target
 
}}
 
 
{{hc|urxvtd.socket|<nowiki>
 
[Unit]
 
Description=urxvt daemon (socket activation)
 
Documentation=man:urxvtd(1) man:urxvt(1)
 
 
[Socket]
 
ListenStream=%t/urxvtd-%H
 
 
[Install]
 
WantedBy=sockets.target
 
</nowiki>}}
 
 
== カットアンドペースト ==
 
 
{{Note|With the use of a VDT multiplexer, urxvt (or any VDT emulator) {{Ic|CLIPBOARD}} integration will not be effective, since it will not be possible to select all of the desired text in a straightforward fashion or at all, in some cases (e.g., when the active multiplexed terminal is changed to another one and then back to the original one, and one selects text beyond what is visible, which causes text from the other terminal to be displayed). Obviously this is due to the fact that the VDT emulator lacks the ability to distinguish between multiplexed terminals. Therefore, it would be effectively redundant for one who always uses a VDT multiplexer capable of maintaining a scrollback buffer and integrating with {{Ic|CLIPBOARD}} (e.g., [[tmux]] with [[tmux#ICCCM Selection Integration|customized key bindings]]) to integrate {{Ic|CLIPBOARD}} with urxvt.}}
 
 
For users unfamiliar with [[Xorg]] data transfer methods, the exchange of information to and from rxvt-unicode can become a burden. Suffice to say that rxvt-unicode uses cut buffers which are typically loaded into the current {{Ic|PRIMARY}} selection by default. [http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.1.pod#THE_SELECTION_SELECTING_AND_PASTING_] Users are urged to review [[Wikipedia:X Window selection]] for additional information.
 
 
==== デフォルトのキーバインディング ====
 
 
Default X key bindings will still work for copying and pasting. After selecting the text Ctrl+Insert can be used to copy and Shift+Insert to paste.
 
 
==== クリップボードの管理 ====
 
 
[[クリップボード#クリップボードマネージャの一覧]]を見て下さい。
 
 
==== Automatic script management ====
 
 
{{Note|Since version 9.20, {{Pkg|rxvt-unicode}} comes with a new {{ic|selection-to-clipboard}} extension that supersedes the scripts below. Enable it like any other extension.}}
 
Skottish[https://bbs.archlinux.org/viewtopic.php?pid=506845#p506845] created a Perl script to automatically copy any selection in rxvt-unicode to the X clipboard. Save the following as {{ic|/usr/lib/urxvt/perl/clipboard}}:
 
 
{{bc|<nowiki>
 
#! /usr/bin/perl
 
 
sub on_sel_grab {
 
my $query=quotemeta $_[0]->selection;
 
$query=~ s/\n/\\n/g;
 
$query=~ s/\r/\\r/g;
 
system( "echo -en " . $query . " | xsel -i -b -p" );
 
}
 
</nowiki>}}
 
 
Xyne has also created his own variation of Skottish's script named {{AUR|urxvt-clipboard}} which is available in the [[AUR]] that allows the user to paste the selection with {{ic|Ctrl+V}} instead of only with a middle mouse click:
 
 
{{bc|<nowiki>
 
#! /usr/bin/perl
 
 
sub on_sel_grab
 
{
 
my $query = $_[0]->selection;
 
open (my $pipe,'|-','xsel -ib') or die;
 
print $pipe $query;
 
close $pipe;
 
open (my $pipe,'|-','xsel -ip') or die;
 
print $pipe $query;
 
close $pipe;
 
}
 
</nowiki>}}
 
 
It also requires {{Pkg|xsel}} and needs to be enabled in the {{Ic|*perl-ext-common}} or {{Ic|*perl-ext}} field in {{ic|~/.Xresources}}. For example:
 
URxvt.perl-ext-common: default,clipboard
 
 
The [[AUR]] package {{AUR|urxvt-perls-git}} is another option one can use. {{AUR|urxvt-perls-git}} includes the same functionality as {{AUR|urxvt-clipboard}}, in addition to the keyboard-select and url-select Perl extensions.
 
 
== Improved Kuake-like behavior in Openbox ==
 
 
This was originally posted on the forum by Xyne [https://bbs.archlinux.org/viewtopic.php?pid=550380], and it relies on the {{Pkg|xdotool}} found in the [[official repositories]].
 
 
=== Scriptlets ===
 
 
Save this scriptlet from the {{Ic|urxvtc}} man page somewhere on your system as {{ic|urxvtc}} (e.g., in {{ic|~/.config/openbox}}):
 
 
{{bc|
 
#!/bin/sh
 
 
urxvtc "$@"
 
if [$? -eq 2]; then
 
urxvtd -q -o -f
 
urxvtc "$@"
 
fi
 
}}
 
 
and save this one as {{ic|urxvtq}}:
 
 
{{bc|<nowiki>
 
#!/bin/bash
 
 
wid=$(xdotool search --classname urxvtq)
 
if [ -z "$wid" ]; then
 
/path/to/urxvtc -name urxvtq -geometry 80x28
 
wid=$(xdotool search --classname urxvtq | head -1)
 
xdotool windowfocus "$wid"
 
xdotool key Control_L+l
 
else
 
if [ -z "$(xdotool search --onlyvisible --classname urxvtq 2>/dev/null)" ]; then
 
xdotool windowmap "$wid"
 
xdotool windowfocus "$wid"
 
else
 
xdotool windowunmap "$wid"
 
fi
 
fi
 
</nowiki>}}
 
 
A previous version of {{Pkg|xdotool}} introduced a bug which disabled recognition of visible windows and thus led some users to use the following scriptlet in place of the previous one. This is no longer necessary as of {{Pkg|xdotool}} >= 1.20100416.2809, but it has been left here for future reference.'
 
 
{{bc|<nowiki>
 
#!/bin/bash
 
 
wid=$(xprop -name urxvtq | grep 'WM_COMMAND' | awk -F ',' '{print $3}' | awk -F '"' '{print $2}')
 
if [ -z "$wid" ]; then
 
/path/to/urxvtc -name urxvtq -geometry 200x28
 
wid=$(xprop -name urxvtq | grep 'WM_COMMAND' | awk -F ',' '{print $3}' | awk -F '"' '{print $2}')
 
xdotool windowfocus "$wid"
 
xdotool key Control_L+l
 
else
 
if [ -z "$(xprop -id "$wid" | grep 'window state: Normal' 2>/dev/null)" ]; then
 
xdotool windowmap "$wid"
 
xdotool windowfocus "$wid"
 
else
 
xdotool windowunmap "$wid"
 
fi
 
fi
 
</nowiki>}}
 
 
Make sure that you change {{Ic|/path/to/urxvtc}} to the actual path to the {{ic|urxvtc}} scriptlet that you saved above. We will be using {{ic|urxvtc}} to launch both regular instances of {{Ic|urxvt}} and the kuake-like instance.
 
 
=== urxvtq with tabbing ===
 
 
If you want to have tabs in your kuake-like {{ic|urxvtc}} (here called {{ic|urxvtq}}) just replace the third line in your {{ic|urxvtq}}:
 
wid=$(xdotool search --name urxvtq)
 
with:
 
wid=$(xdotool search --name urxvtq | grep -m 1 "" )
 
 
To activate tab support, you can either replace the fifth line of your {{ic|urxvtq}}:
 
/path/to/urxvtc -name urxvtq -geometry 80x28
 
with:
 
/path/to/urxvtc -name urxvtq -pe tabbed -geometry 80x28
 
or replace this line of your {{ic|~/.Xresources}} file:
 
URxvt.perl-ext-common: default,matcher
 
with
 
URxvt.perl-ext-common: default,matcher,tabbed
 
 
==== Tab control ====
 
 
{| class="wikitable"
 
! Key !! Description
 
|-
 
| Shift+Left || Switch to the tab left of the current one
 
|-
 
| Shift+Right || Switch to the tab right of the current one
 
|-
 
| Shift+Down || Create a new tab
 
|}
 
 
You can also use your mouse to switch the tabs by clicking the wished one and create a new tab by clicking on ''[NEW].\\''
 
 
To close a tab just enter {{Ic|exit}} like you would to normally close a terminal.
 
 
=== Openbox の設定 ===
 
 
Now add the following lines to the {{Ic|<applications>}} section of {{ic|~/.config/openbox/rc.xml}}:
 
 
{{bc|1=
 
<application name="urxvtq">
 
<decor>no</decor>
 
<position force="yes">
 
<x>center</x>
 
<y>0</y>
 
</position>
 
<desktop>all</desktop>
 
<layer>above</layer>
 
<skip_pager>yes</skip_pager>
 
<skip_taskbar>yes</skip_taskbar>
 
<maximized>Horizontal</maximized>
 
</application>
 
}}
 
 
and add these lines to the {{Ic|<keyboard>}} section:
 
 
{{bc|1=
 
<keybind key="W-t">
 
<action name="Execute">
 
<command>/path/to/urxvtc</command>
 
</action>
 
</keybind>
 
<keybind key="W-grave">
 
<action name="Execute">
 
<execute>/path/to/urxvtq</execute>
 
</action>
 
</keybind>
 
}}
 
 
Here too you need to change the {{Ic|/path/to/*}} lines to point to the scripts that you saved above. Save the file and then reconfigure Openbox. You should now be able to launch regular instances of urxvt with {{ic|Super+T}}, and toggle the kuake-like console with {{ic|Super+'''`'''}} (the grave key also known as the backtick).
 
 
=== Further configuration ===
 
 
The advantage of this configuration over the urxvt kuake Perl script is that Openbox provides more keybinding options such as modifier keys. The kuake script hijacks an entire physical key regardless of any modifier combination. Review the [http://icculus.org/openbox/index.php/Help:Bindings Openbox bindings documentation] for the full range or possibilities.
 
 
The [http://icculus.org/openbox/index.php/Help:Applications Openbox per-app settings] can be used to further configure the behavior of the kuake-like console (e.g. screen position, layer, etc.). You may need to change the "geometry" parameter in the {{ic|urxvtq}} scriptlet to adjust the height of the console.
 
 
=== Related scripts ===
 
 
* hbekel has posted a generalized version of the {{ic|urxvtq}} [https://bbs.archlinux.org/viewtopic.php?pid=550380#p550380 here] which can be used to toggle any application using {{Pkg|xdotool}}.
 
* http://www.jukie.net/~bart/blog/20070503013555 - A script for opening URLs with your keyboard instead of mouse with urxvt.
 
   
 
== トラブルシューティング ==
 
== トラブルシューティング ==
   
  +
=== v9.09 にアップグレードした後に透過が機能しない ===
=== ~/.Xresources is not being sourced ===
 
 
In some cases where urxvt does not acknowledge {{ic|~/.Xresources}}, you may need to add {{ic|xrdb -merge ~/.Xresources}} to your {{ic|~/.xinitrc}} file. See [[X resources]] for more information.
 
 
=== Transparency not working after upgrade to v9.09 ===
 
   
  +
rxvt-unicode の開発者によって壁紙を設定するプログラムとの互換性が大幅に削除されました。対応していない壁紙設定プログラムを使うと透過が機能しなくなります。推奨されている壁紙設定プログラムは以下です:
The rxvt-unicode developers removed compatibility code for a lot of non standard wallpaper setters with this update. Using a non compatible wallpaper setter will break transparency support. Recommended wallpaper setters:
 
   
 
* [[feh]]
 
* [[feh]]
634行目: 274行目:
 
* esetroot
 
* esetroot
   
To make true transparency work, make sure to comment URxvt.tintColor and URxvt.inheritPixmap.
+
完全透過を使うには、URxvt.tintColor URxvt.inheritPixmap をコメントアウトしてください。
   
 
=== リモートホスト ===
 
=== リモートホスト ===
   
If you are logging into a remote host, you may encounter problems when running text-mode programs under rxvt-unicode. This can be fixed by installing {{Pkg|rxvt-unicode-terminfo}} on the remote host or by copying {{ic|/usr/share/terminfo/r/rxvt-unicode}} from your local machine to your host at {{ic|~/.terminfo/r/rxvt-unicode}}; same for rxvt-unicode-256color.
+
リモートホストにログインしているときに、urxvt-unicode を使ってテキストモードプログラムを実行すると問題が発生することがあります。その場合は {{Pkg|rxvt-unicode-terminfo}} をリモートホストにインストールするかローカルホストの {{ic|/usr/share/terminfo/r/rxvt-unicode}} をリモートホストの {{ic|~/.terminfo/r/rxvt-unicode}} にコピーすれば解決できます。rxvt-unicode-256color の場合も同様です。
   
  +
一部のリモートシステムには TERM=xterm と明記しないと自動的にタイトルが変更しないものもあります。それを修正するには、次の行をリモートマシンの .bashrc に追記してください:
Some remote systems do not change title automatically unless you specify TERM=xterm. To fix the issue add this line to .bashrc on the remote machine:
 
   
 
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}:${PWD}\007"'
 
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}:${PWD}\007"'
   
=== Using rxvt-unicode as gmrun terminal ===
+
=== rxvt-unicode gmrun ターミナルとして使う ===
   
  +
他のターミナルとは異なり、urxvt は {{Ic|-e}} への引数としてクォートで囲まれた引数ではなく分割された引数を取ります。この挙動は、クォートで囲まれた引数を期待する gmrun を使うときトラブルになります。これを避けるには、{{ic|.gmrunrc}} にて gmrun の変数である "Terminal" の前に "eval" を置いてください (gmrun はコマンドを実行するのに {{ic|/bin/sh}} を使うため、"eval" は解釈されます):
Unlike some other terminals, urxvt expects the arguments to {{Ic|-e}} to be given separately, rather than grouped together with quotes. This causes trouble with gmrun, which assumes the opposite behavior. This can be worked around by putting an "eval" in front of gmrun's "Terminal" variable in {{ic|.gmrunrc}}:
 
   
 
Terminal = eval urxvt
 
Terminal = eval urxvt
 
TermExec = ${Terminal} -e
 
TermExec = ${Terminal} -e
   
  +
[[Bash]] でいう {{Ic|$@}} と同じように "eval" は {{Ic|-e}} の引数を"分割する"副作用を持つので、コマンドを urxvt に上手く渡せます。
(gmrun uses {{ic|/bin/sh}} to execute commands, so the "eval" is understood here.) The "eval" has the side-effect of "breaking up" the argument to {{Ic|-e}} in the same way that {{Ic|$@}} does in [[Bash]], making the command intelligible to urxvt.
 
   
  +
=== テンキーの出力がおかしい (例: vim) ===
=== My numerical keypad acts weird and generates differing output? (e.g. in vim) ===
 
   
  +
Debian GNU/Linux ユーザーによってこの症状が報告されていますが、詳細はわかっていません。TERM=rxvt が互換性あるキーマップを提供していても、どの設定でどのようにして起こるのか不明にも関わらず、間違った TERM 設定によりこの問題が起こる可能性があります。この問題に対する解決策を確認でき、助けになるならレポートしてください。
Some Debian GNU/Linux users seem to have this problem, although no specific details were reported so far. It is possible that this is caused by the wrong TERM setting, although the details of whether and how this can happen are unknown, as TERM=rxvt should offer a compatible keymap. See the answer to the previous question, and please report if that helped.
 
   
However, using the ''xmodmap'' program ({{Pkg|xorg-xmodmap}}), you can re-map your number pad keys back.
+
ただ、''xmodmap'' プログラム ({{Pkg|xorg-xmodmap}}) を使い、テンキーをリマップすることができます。
   
  +
1. {{ic|xev}} プログラム使用時にて数字キー(テンキー)が生成するキーコードを確認。
1. Check the keycode that your numerical keypad (numpad) generates using {{ic|xev}} program.
 
   
* Start the {{ic|xev}} program
+
* {{ic|xev}} プログラムを起動します
  +
* キーコードを入力して {{ic|xev}} が出力する ''... keycode xxx ...'' を探してください。例えば、キーボードによってはテンキー1が ''''keycode 87'''' の "End" キーになります。
* Press your number pad keys and look for ''... keycode xxx ...'' in {{ic|xev}}'s output. For example, numpad 1 in my keyboard is also "End" key, that have a ''''keycode 87''''.
 
   
2. Create or modify your xmodmap file, usually {{ic|~/.Xmodmap}}, with the content representing your keycode.
+
2. キーコードを表現する xmodmap ファイル (大抵の場合 {{ic|~/.Xmodmap}}) を作成あるいは変更してください
   
  +
数字キーを記述した xmodmap ファイルの例:
Example of xmodmap file with number pad keycode:
 
   
 
{{bc|1=
 
{{bc|1=
687行目: 327行目:
 
}}
 
}}
   
  +
3. xmodmap フィアルを X セッションの起動時に読み込む。
3. Load your xmodmap file at X session start-up.
 
   
For example, in {{ic|~/.xinitrc}} file add:
+
例えば、以下の行を {{ic|~/.xinitrc}} に追記します:
   
 
...
 
...
695行目: 335行目:
 
...
 
...
   
  +
=== 特定のキーの組み合わせが機能しない ===
=== Pseudo-tty ===
 
   
  +
[http://vim.wikia.com/wiki/Get_Alt_key_to_work_in_terminal?useskin=monobook Get Alt key to work in terminal] を見てください。
The following error is likely caused by {{ic|/dev/pts}} having been mounted with the wrong options.
 
   
  +
=== 文字を表示するときに遅くなる ===
urxvt: can't initialize pseudo-tty, aborting.
 
   
  +
alsamixer や xprop といったプログラムではグラフィックドライバが上手く動かず再描画が酷く遅くなります。{{ic|~/.Xresources}} のオプション "skipBuiltinGlyphs" かコマンドラインオプション {{ic|-sbg}} によって修正可能です。{{ic|~/.Xresources}} に以下の行を追記することで解決します:
Remove {{ic|/dev/pts}} from {{ic|/etc/fstab}} and fix the current mount options with:
 
   
  +
URxvt*skipBuiltinGlyphs: true
sudo mount -o remount,gid=5,mode=620 /dev/pts
 
   
  +
=== 長い行で動作が遅くなる ===
See also [https://mailman.archlinux.org/pipermail/arch-dev-public/2013-August/025332.html], {{bug|36548}}, and [https://bbs.archlinux.org/viewtopic.php?pid=1318127].
 
   
  +
{{ic|matcher}} プラグインが原因かもしれません。{{ic|matcher}} プラグインは行が更新される度に正規表現によるマッチを行うため、{{ic|saveLines}} を巨大な値に設定していると問題が悪化します。
=== Key combinations do not work ===
 
   
  +
シンプルな回避方法は以下の通りです:
See [http://vim.wikia.com/wiki/Get_Alt_key_to_work_in_terminal?useskin=monobook Get Alt key to work in terminal].
 
   
  +
* {{ic|saveLines}} を小さくする
=== Slow performance when drawing glyphs ===
 
  +
* {{ic|matcher}} プラグインを無効にする
   
  +
上記の方法が使えない場合、特定の行から URL マッチを無効化させることもできます:
Some programs like alsamixer and xprop do not perform well with some graphics drivers and in consequence redraw very slowly. The option "skipBuiltinGlyphs" for {{ic|~/.Xresources}} or the command line option {{ic|-sbg}} may fix this. One possible solution is to add the following to {{ic|~/.Xresources}}:
 
   
  +
# {{ic|/usr/lib/urxvt/perl/matcher}} を {{ic|~/.urxvt/ext/}} へコピーします (ディレクトリがない場合は作成してください)
URxvt*skipBuiltinGlyphs: true
 
  +
# {{ic|~/.urxvt/ext/matcher}} を編集します。サブルーチンである {{ic|on_line_update}} の {{ic|<nowiki>my ($self, $row) = @_;</nowiki>}} の行を見付けてください。270行目のはずです。
  +
# その行の後に、次の行を追加してください {{ic|return () if $row < -100;}} 。これでターミナルの一番上から100行目以降での URL マッチを防げます。
  +
  +
=== 画面の位置とサイズが違う ===
  +
  +
{{Accuracy|This should provide more details on what is considered a "wrong window geometry" since the changelog from 2023-01-02 does not mention window geometry.}}
  +
  +
[http://dist.schmorp.de/rxvt-unicode/Changes 2023-01-02 update] では、{{ic|~/.Xresources}} にいくつかの行を追加する必要がある場合があります。
  +
  +
URxvt.geometry: 400x400
  +
  +
=== Neovim で devicons が Nerd フォントを使用している場合でも空の四角形としてレンダリングされる ===
  +
  +
{{ic|~/.Xresources}} で使用する Nerd Font の {{ic|Mono}} バリアントを指定してみてください:
  +
  +
URxvt.font: xft:Fira Code Nerd Font '''Mono'''
   
== 外部資料 ==
+
== 参照 ==
   
 
* [http://software.schmorp.de/pkg/rxvt-unicode.html rxvt-unicode] - 公式サイト
 
* [http://software.schmorp.de/pkg/rxvt-unicode.html rxvt-unicode] - 公式サイト
 
* [http://cvs.schmorp.de/rxvt-unicode/ Source Code] - Browseable CVS
 
* [http://cvs.schmorp.de/rxvt-unicode/ Source Code] - Browseable CVS
 
* [http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod rxvt-unicode FAQ] - 公式 FAQ
 
* [http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod rxvt-unicode FAQ] - 公式 FAQ
* [http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.1.pod rxvt-unicode Reference] - Official manual page
+
* [http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.1.pod rxvt-unicode Reference] - 公式マニュアルページ
* [http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/src/urxvt.pm urxvtperl] - Official Perl extension reference
+
* [http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/src/urxvt.pm urxvtperl] - 公式 Perl 拡張リファレンス

2023年12月5日 (火) 04:29時点における最新版

関連記事

rxvt-unicode は細かいカスタマイズができるターミナルエミュレータで rxvt のフォークです。rxvt-unicode の取り柄としては Unicode による多言語サポートや、透過、複数のフォントタイプの表示機能、Perl 拡張のサポートなどが挙げられます。

インストール

rxvt-unicode パッケージでインストールすることができます。

設定

設定と値の完全なリストは urxvt(1)urxvt(7) を見て下さい。

Xresources

rxvt-unicode の外観や機能はコマンドラインの引数や X resources によって制御されます。コマンドライン引数は X resources の設定よりも優先して適用されます。

urxvt --help は全ての rxvt リソースを標準エラーに出力します。各リソースの説明は man ページに存在します。

スクロールバックの位置

デフォルトでは、シェル出力が更新されると、スクロールバックの表示は自動的にバッファの最後にジャンプし、新しい出力を表示します。前の出力 (コンパイラメッセージなど) を表示したい場合は ~/.Xresources に以下のオプションを設定します:

! do not scroll with output
URxvt*scrollTtyOutput: false

! scroll in relation to buffer (with mouse scroll or Shift+Page Up)
URxvt*scrollWithBuffer: true

! scroll back to the bottom on keypress
URxvt*scrollTtyKeypress: true

セカンダリスクリーンのスクロールバッファ

セカンダリスクリーン でページャをスクロールすると (例えば less-X オプションを省略した場合)、端末のバッファではなくページャ内でスクロールできるようスクロールバックバッファを無効にすることをお勧めします。konsole および vte ベースの端末ではデフォルトでこういう仕様になっており動作を変更できません。urxvt で セカンダリスクリーンのスクロールバックバッファを無効にするには:

URxvt.secondaryScreen: 1
URxvt.secondaryScroll: 0

上記の設定は、マウスホイールを使用してスクロールする場合を除いて、期待通りに機能します。マウスホイールでセカンダリスクリーンのページャをスクロールしたとき、スクロールバックバッファに何かがあると、ページャの代わりにスクロールバックバッファがマウスホイールでスクロールされます。この問題を解決するには、rxvt-unicode に新しいオプションを導入する必要があります [1] AUR の rxvt-unicode-better-wheel-scrollingAUR でパッチが適用された rxvt-unicode が利用できます。パッケージのインストール後、以下を設定ファイルに追加してください:

URxvt.secondaryWheel: 1
ノート: perl 拡張の urxvt-vtwheelAUR は上記のオプションと衝突します。

フォントを宣言する方法

URxvt.font: 9x15

上記の設定は以下と同じです:

URxvt.font: -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-1

同じフォントを太字で使用するには:

URxvt.font: 9x15bold

上記の設定は以下と同じです:

URxvt.font: -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-1

X コアフォントの短縮名の完全なリストは /usr/share/fonts/misc/fonts.alias にあります (/usr/share/fonts/ のサブディレクトリにも fonts.alias ファイルが存在しますが、実際のフォントとは別のパッケージになっているため、インストールされていないフォントも含まれます)。フォントの短縮エイリアスは ISO-10646-1 (Unicode) バージョンではなく ISO-8859-1 バージョンを選択し、100 DPI バージョンではなく 75 DPI バージョンのフォントが使われるため、フォントを選択したいときは長い方の名前を使ってください。

上記はビットマップフォントの話で、他のフォントは以下のように Xft で使うことができます:

URxvt.font: xft:monaco:size=10

または:

URxvt.font: xft:monaco:bold:size=10
ノート: Xft のフォント名にハイフン (-) が含まれている場合は、バックスラッシュ (\) を2回打ってエスケープしてください。バックスラッシュ1回でエスケープする urxvt の -fn オプションや fc-list の出力とは仕方が異なります。

以下のようにターミナルにエスケープコードを出力することで一時的にフォントをテストすることが可能です:

$ printf '\e]710;%s\007' "xft:Terminus:pixelsize=12"

フォントの間隔

デフォルトでは文字の間隔が広すぎるように感じられる場合、以下のエントリで調整できます:

~/.Xresources
URxvt.letterSpace: -1

-1 で1ピクセル文字の間隔が狭まります。必要ならばもっと狭めることもできます。

カラー

デフォルトで、rxvt-unicode はカラーサポートを有効にしてコンパイルされています。デフォルトの前景色・背景色に加えて、rxvt は256色まで表示することができます (太字・点滅・下線とそれらの組み合わせも可能です)

foreground, background, cursorColor, cursorColor2, colorBD, colorUL は0から15の数字で色を指定することができ、短い名前で color0-color15 の色を使うことができます。詳しくは #Xresources を参照。

ノート: デフォルトでは urxvtXterm と同じ色を使用しますが、ひとつだけ違う色があります。変更するには Xresources に URxvt.color12: rgb:5c/5c/ff を追加してください。

印刷

デフォルトで、rxvt-unicode は PrintScreen が押されたときに lpr でスクリーンキャプチャをプリントします。Ctrl+PrintScreen または Shift-PrintScreen を使うとターミナルのスクロールバックも印刷されます。設定によって挙動を変更したり無効化することが可能です。

~/.Xresources
! Disable printing the terminal contents when pressing PrintScreen.
URxvt.print-pipe: "cat > /dev/null"

設定をリロードする

設定を変更した後、xrdb ~/.Xresources を実行して、設定をリロードします。新しい設定は全ての新しい端末に適用されます。

カットアンドペースト

Rxvt-unicode はデフォルトで PRIMARY セレクションにロードされているカットバッファを使います。詳しくは Selecting and pasting text を見てください。

ALT-CTRL-cALT-CTRL-v でコピーアンドペーストができます。

ノート: 選択したテキストは自動的に PRIMARY にコピーされます。rxvt-unicode 9.20 から perl 拡張selection-to-clipboard を使うことでテキストを CLIPBOARD にコピーできます。

選択した内容を PRIMARY にコピーし、CLIPBOARD が選択した内容で更新されていることを確認するには、次を追加します。

URxvt.perl-ext-common:  ...,clipboard,...

以下を追加

URxvt.clipboard.autocopy: true
URxvt.keysym.M-c: perl:clipboard:copy
URxvt.keysym.M-v: perl:clipboard:paste

クリップボード#クリップボードマネージャの一覧も参照。

Perl 拡張

次の行を含めることで、URxvt perl 拡張機能を有効にできます。

 URxvt.perl-ext-common: extension_name_1,extension_name_2,...

拡張子名の間にスペースを 入れないように 注意してください。

クリックできる URL

matcher 拡張を使うことでターミナルに表示された URL をクリックできるようになります。例えば、(規定のウェブブラウザを使って) 左マウスボタンでリンクを開くには、以下を .Xresources に追加します:

URxvt.perl-ext-common: default,matcher
URxvt.url-launcher: /usr/bin/xdg-open
URxvt.matcher.button: 1

rxvt-unicode 9.14 から、キーボードを使って最近閲覧した URL を開いたり確認することもできるようになりました:

URxvt.keysym.C-Delete: perl:matcher:last
URxvt.keysym.M-Delete: perl:matcher:list

マッチするリンクに前景色・背景色といったを付けることもできます。例えば青色なら以下のようになります:

URxvt.matcher.rend.0: Uline Bold fg5

他には、colorUL を使えば #RRGGBB スタイルでの色付けができます。ただし、これはリンクにマッチした部分だけでなく下線付きテキストのすべてに適用されます:

URxvt.colorUL: #4682B4

ヤンクできる URL (マウスを使用しない)

また、マウスを使わずに選択した URL をブラウザで開くこともできます。

urxvt-perls パッケージをインストールして適当に .Xresources を調整してください。例:

URxvt.perl-ext: default,url-select
URxvt.keysym.M-u: perl:url-select:select_next
URxvt.url-select.launcher: /usr/bin/xdg-open
URxvt.url-select.underline: true
ノート: この拡張は、上で説明したクリックできる URL拡張を置き換えるため、matcherURxvt.perl-ext のリストから除外してください。

キーコマンド:

キー 説明
Alt+u 選択モードに移行。スクリーン上にある最後のURLが選択されます。Alt+u を繰り返せば更に上にある URL を選択できます。
k 上にある URL を選択
j 下にある URL を選択
Return 選択モードを終了して選択した URL をブラウザで開く
o 選択モードを終了せずに選択した URL をブラウザで開く
y 選択モードを終了して選択した URL をコピーする
Esc URL 選択モードをキャンセル。

シンプルなタブ

urxvt にタブを追加するには、以下を ~/.Xresources に追加します:

URxvt.perl-ext-common: ...,tabbed,...

タブをコントロールするには:

キー 説明
Shift+Down 新しいタブ
Shift+Left 左のタブに移動
Shift+Right 右のタブに移動
Ctrl+Left タブを左に移動
Ctrl+Right タブを右に移動
Ctrl+d タブを閉じる

タブの色は以下のようにして変更できます:

URxvt.tabbed.tabbar-fg: 2
URxvt.tabbed.tabbar-bg: 0
URxvt.tabbed.tab-fg: 3
URxvt.tabbed.tab-bg: 0

フルスクリーン

urxvt-fullscreenAUR パッケージをインストールして、urxvt をフルスクリーンにするキーバインディングを設定することができます:

~/.Xresources
...
URxvt.perl-ext-common: ..., fullscreen, ...
URxvt.keysym.F11: perl:fullscreen:switch
...

フォントサイズを即座に変更

urxvt-resize-font-gitAUR パッケージをインストールして ~/.Xresources の Perl 拡張に以下を追加してください:

URxvt.perl-ext-common:  ...,resize-font,...

デフォルトのキーバインド:

  • Ctrl++ (または Ctrl+Shift+=) でサイズを大きくする
  • Ctrl+- でサイズを小さくする
  • Ctrl+= でサイズをリセットする
  • Ctrl+? で現在のサイズを表示

以下のようにキーバインドを変更することもできます:

URxvt.keysym.C-Down:  resize-font:smaller
URxvt.keysym.C-Up:    resize-font:bigger

キーバインドとして Ctrl+Shift を使うなら、デフォルトのキーバインドを無効化しておく必要があります (詳細):

URxvt.iso14755: false
URxvt.iso14755_52: false

Perl 拡張の無効化

Perl 拡張機能を使っていない場合、完全に Perl 拡張を無効化することでセキュリティと性能を高めることができます:

URxvt.perl-ext:
URxvt.perl-ext-common:
ノート: 複数の Perl 拡張を使うなら、次のようにカンマ区切りに並べて記述することができます: URxvt.perl-ext-common:default,matcher,tabbed

インプットメソッドのインライン表示

urxvt でインプットメソッドをインライン表示にする場合は、以下を ~/.Xresources に追加します:

URxvt.perl-ext-common: ...,xim-onthespot,...

インプットメソッドの指定とプレエディットタイプの設定も必要になります (fcitx の部分は自分が使用しているインプットメソッドに変更する必要があります):

URxvt.inputMethod: fcitx
URxvt.preeditType: OnTheSpot

トラブルシューティング

v9.09 にアップグレードした後に透過が機能しない

rxvt-unicode の開発者によって壁紙を設定するプログラムとの互換性が大幅に削除されました。対応していない壁紙設定プログラムを使うと透過が機能しなくなります。推奨されている壁紙設定プログラムは以下です:

  • feh
  • hsetroot
  • esetroot

完全透過を使うには、URxvt.tintColor と URxvt.inheritPixmap をコメントアウトしてください。

リモートホスト

リモートホストにログインしているときに、urxvt-unicode を使ってテキストモードプログラムを実行すると問題が発生することがあります。その場合は rxvt-unicode-terminfo をリモートホストにインストールするかローカルホストの /usr/share/terminfo/r/rxvt-unicode をリモートホストの ~/.terminfo/r/rxvt-unicode にコピーすれば解決できます。rxvt-unicode-256color の場合も同様です。

一部のリモートシステムには TERM=xterm と明記しないと自動的にタイトルが変更しないものもあります。それを修正するには、次の行をリモートマシンの .bashrc に追記してください:

PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}:${PWD}\007"'

rxvt-unicode を gmrun ターミナルとして使う

他のターミナルとは異なり、urxvt は -e への引数としてクォートで囲まれた引数ではなく分割された引数を取ります。この挙動は、クォートで囲まれた引数を期待する gmrun を使うときトラブルになります。これを避けるには、.gmrunrc にて gmrun の変数である "Terminal" の前に "eval" を置いてください (gmrun はコマンドを実行するのに /bin/sh を使うため、"eval" は解釈されます):

Terminal = eval urxvt
TermExec = ${Terminal} -e

Bash でいう $@ と同じように "eval" は -e の引数を"分割する"副作用を持つので、コマンドを urxvt に上手く渡せます。

テンキーの出力がおかしい (例: vim)

Debian GNU/Linux ユーザーによってこの症状が報告されていますが、詳細はわかっていません。TERM=rxvt が互換性あるキーマップを提供していても、どの設定でどのようにして起こるのか不明にも関わらず、間違った TERM 設定によりこの問題が起こる可能性があります。この問題に対する解決策を確認でき、助けになるならレポートしてください。

ただ、xmodmap プログラム (xorg-xmodmap) を使い、テンキーをリマップすることができます。

1. xev プログラム使用時にて数字キー(テンキー)が生成するキーコードを確認。

  • xev プログラムを起動します
  • キーコードを入力して xev が出力する ... keycode xxx ... を探してください。例えば、キーボードによってはテンキー1が 'keycode 87' の "End" キーになります。

2. キーコードを表現する xmodmap ファイル (大抵の場合 ~/.Xmodmap) を作成あるいは変更してください

数字キーを記述した xmodmap ファイルの例:

keycode 63 = KP_Multiply
keycode 79 = Home KP_7
keycode 80 = Up KP_8
keycode 81 = Prior KP_9
keycode 82 = KP_Subtract
keycode 83 = Left KP_4
keycode 84 = KP_5
keycode 85 = Right KP_6
keycode 86 = KP_Add
keycode 87 = End KP_1
keycode 88 = Down KP_2
keycode 89 = Next KP_3
keycode 90 = Insert KP_0
keycode 91 = Delete KP_Decimal
keycode 112 = Prior
keycode 117 = Next

3. xmodmap フィアルを X セッションの起動時に読み込む。

例えば、以下の行を ~/.xinitrc に追記します:

...
xmodmap ~/.Xmodmap
...

特定のキーの組み合わせが機能しない

Get Alt key to work in terminal を見てください。

文字を表示するときに遅くなる

alsamixer や xprop といったプログラムではグラフィックドライバが上手く動かず再描画が酷く遅くなります。~/.Xresources のオプション "skipBuiltinGlyphs" かコマンドラインオプション -sbg によって修正可能です。~/.Xresources に以下の行を追記することで解決します:

URxvt*skipBuiltinGlyphs:    true

長い行で動作が遅くなる

matcher プラグインが原因かもしれません。matcher プラグインは行が更新される度に正規表現によるマッチを行うため、saveLines を巨大な値に設定していると問題が悪化します。

シンプルな回避方法は以下の通りです:

  • saveLines を小さくする
  • matcher プラグインを無効にする

上記の方法が使えない場合、特定の行から URL マッチを無効化させることもできます:

  1. /usr/lib/urxvt/perl/matcher~/.urxvt/ext/ へコピーします (ディレクトリがない場合は作成してください)
  2. ~/.urxvt/ext/matcher を編集します。サブルーチンである on_line_updatemy ($self, $row) = @_; の行を見付けてください。270行目のはずです。
  3. その行の後に、次の行を追加してください return () if $row < -100; 。これでターミナルの一番上から100行目以降での URL マッチを防げます。

画面の位置とサイズが違う

この記事またはセクションの正確性には問題があります。
理由: This should provide more details on what is considered a "wrong window geometry" since the changelog from 2023-01-02 does not mention window geometry. (議論: トーク:Rxvt-unicode#)

2023-01-02 update では、~/.Xresources にいくつかの行を追加する必要がある場合があります。

URxvt.geometry: 400x400

Neovim で devicons が Nerd フォントを使用している場合でも空の四角形としてレンダリングされる

~/.Xresources で使用する Nerd Font の Mono バリアントを指定してみてください:

URxvt.font: xft:Fira Code Nerd Font Mono

参照