「Rxvt-unicode」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(→‎擬似透過: inheritPixmapの設定を追加)
68行目: 68行目:
 
! Xresources file
 
! Xresources file
   
  +
URxvt*inheritPixmap: true
 
URxvt*.transparent: true
 
URxvt*.transparent: true
 
! URxvt*.shading: 0 to 99 darkens, 101 to 200 lightens
 
! URxvt*.shading: 0 to 99 darkens, 101 to 200 lightens

2015年12月18日 (金) 14:14時点における版

rxvt-unicode は細かいカスタマイズができるターミナルエミュレータrxvt のフォークです。一般に urxvt と呼ばれている、rxvt-unicode はデーモン化して一つのプロセスで複数のクライアントを実行することができ、システムリソースの使用を抑えることができます。Marc Lehmann によって開発されており、rxvt-unicode の取り柄としては Unicode による多言語サポートや、複数のフォントタイプの表示機能、Perl 拡張のサポートなどが挙げられます。

目次

インストール

rxvt-unicode公式リポジトリからインストールすることができ、256色のカラーをサポートしています。

また、AUR からは rxvt-unicode-patchedAUR をインストールでき、フォントの太さに関するバグが修正されています。

設定

設定と値の完全なリストは rxvt-unicode リファレンスページ を見て下さい。

~/.Xresources の作成

rxvt-unicode の外観や機能はコマンドラインの引数や X resources によって制御されます。X resources は ~/.Xresources や xrdb (xorg-xrdb) を使って設定することができます。詳しくは X resources を見て下さい。

Append commented list of all rxvt resources to your ~/.Xresources file:

urxvt --help 2>&1| sed -n '/:  /s/^ */! URxvt*/gp' >> ~/.Xresources

Or for a commented list + helpful descriptions:

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
ノート: Command-line arguments override, and take precedence over resource settings

完全透過

完全透過を使用するには、コンポジタによるコンポジットをサポートしているウィンドウマネージャを使っている必要があります。

コマンドラインから:

$ urxvt -depth 32 -bg rgba:3f00/3f00/3f00/dddd

設定ファイルを使用:

~/.Xresources
URxvt.depth: 32
URxvt.background: rgba:1111/1111/1111/dddd

または:

~/.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.

ノート: To make these settings universal for all forms of URxvt, you may add a wildcard. For example, URxvt.depth would become URxvt*.depth.

擬似透過

完全透過の必要がない場合、もしくはコンポジットによるシステムリソースの消費が多すぎるという場合、以下のようにして透過を使うことができます:

~/.Xresources
! Xresources file

URxvt*inheritPixmap: true
URxvt*.transparent: true
! URxvt*.shading: 0 to 99 darkens, 101 to 200 lightens
URxvt*.shading: 110

上記の URxvt*.shading の代わりに URxvt*background を使うこともできます。

ノート: Avoid using shading if you have a URxvt.tintColor set. Use a different tintColor instead.

スクロールバー

The look of the scrollbar can be chosen through this entry in ~/.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 ~/.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

Scrollback buffer in secondary screen

When you scroll a pager in a secondary screen(e.g. less without the -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.secondaryScroll: 0

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[1]. A patched rxvt-unicode is available in AUR as rxvt-unicode-better-wheel-scrollingAUR. After installing it, add the following to the configuration file:

URxvt.secondaryWheel: 1
ノート: vtwheel perl 拡張を使っている場合、このオプションを使ってはいけません。

Font declaration methods

URxvt.font: 9x15

is the same as:

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

is the same as:

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

The complete list of short names for X core fonts can be found in /usr/share/fonts/misc/fonts.alias (there's also some fonts.alias files in some of the other subdirectories of /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.

ノート: 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

Or

URxvt.font: xft:monaco:bold:size=10
ノート:
  • 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
  • You will see a new font only after restart X

A nice method for testing out fonts in a live terminal before committing to the config is by printing escape codes in the terminal, for example:

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

アイコンの設定

ノート: Because of a bug report FS#34862 complaining that the rxvt-unicode package had too many dependencies, you must now install the AUR package rxvt-unicode-pixbufAUR 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 ~/.Xresources and pointing to the desired icon:

URxvt.iconFile:    /usr/share/icons/Clarity/scalable/apps/terminal.svg

ログインシェルに設定

This will cause the shell to be started as a login shell, like the option -ls.

URxvt*loginShell: true

urxvt をアプリケーションランチャーとして使う

urxvt can be used as a lightweight alternative to application launchers such as gmrun. Run urxvt with the following configuration to imitate look and behaviour of an application launcher or assign the command to a custom alias:

$ urxvt -geometry 80x3 -name 'bashrun' -e sh -c "/bin/bash -i -t"

フォントの間隔

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

~/.Xresources
URxvt.letterSpace: -1

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

Perl 拡張

クリックできる URL

You can make URLs in the terminal clickable using the matcher extension. For example, to open links in Firefox add the following to .Xresources:

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

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.M-Delete: perl:matcher:list

Matching links can be colored with a chosen foreground or background color, for example blue:

URxvt.matcher.rend.0: Uline Bold fg5

Alternatively, use colorUL for a #RRGGBB color. This will however color all underlined text, instead of only link matches:

URxvt.colorUL: #4682B4

ヤンクできる URL (no mouse)

In addition, you can select and open URLs in your web browser without using the mouse.

公式リポジトリから 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
ノート: This extension replaces the Clickable URLs extension mentioned above, so matcher can be removed from the URxvt.perl-ext list.

キーコマンド:

キー 説明
Alt+u Enter selection mode. The last URL on your screen will be selected. You can repeat Alt+u to select the next upward URL.
k Select next upward URL
j Select next downward URL
Return Open selected URL in browser and quit selection mode
o Open selected URL in browser without quitting selection mode
y Copy (yank) selected URL and quit selection mode
Esc Cancel URL selection mode

シンプルなタブ

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

高度なタブの管理

AUR から urxvt-tabbedexAUR パッケージをインストールして、~/.XresourcesURxvt.perl-ext-common X リソースに tabbedex を追加してください:

URxvt.perl-ext-common: ...,tabbedex,...
ノート: If you have previously used the tabbed Perl extension and have defined the tabbed value for the URxvt.perl-ext-common X resource, please remove the tabbed value first to avoid conflict with 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 new-button to yes.

URxvt.tabbed.new-button: true

Tabs can be named with Shift+ ↑ (Enter to confirm, 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: tabbedex:(new|next|prev)_tab. 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: tabbedex:move_tab_(left|right) and 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
ノート: Redefining the keys used for the user commands will not disable the default mappings, you have to set the X resource no-tabbedex-keys for that. However, currently it is not included in urxvt-tabbedexAUR package. Consider using urxvt-tabbedex-gitAUR package instead:
URxvt.tabbed.no-tabbedex-keys: true

フルスクリーン

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

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

スクロールホイールのサポート

AUR から urxvt-vtwheelAUR をインストールして ~/.Xresources の Perl 拡張に以下を追加してください:

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

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

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

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

そして、以下のようにキーバインディングを追加します:

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

For the suggested Ctrl+Shift bindings to work, a default binding needs to be disabled (see discussion here):

URxvt.iso14755: false
URxvt.iso14755_52: false

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-common:
ノート: If you use multiple Perl extension features, you can list them in succession, comma-separated: 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). The look, feel, and function of rxvt-unicode is controlled by command-line arguments called X resources.

A sample ~/.Xresources for an urxvt terminal with default colors but white fonts on a black background would be written as follow:

~/.Xresources
! 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 to create a commented ~/.Xresources file for urxvt

Xterm のようなカラー

By default urxvt uses the same colors as xterm use except one. Add the following line at the end of your ~/.Xresources for xterm-like colors:

~/.Xresources
...
URxvt*color12: rgb:5c/5c/ff

then merge it contents with your current X resources configuration with:

xrdb -merge ~/.Xresources

and finally restart urxvt.

パフォーマンスの改善

  • Avoid the use of Xft fonts. If Xft fonts must be used, append :antialias=false to the setting value.[2]
  • Build rxvt-unicode with disabled support for unnecessary features, --disable-xft and --disable-unicode3 in particular.[3]
  • Limit the number of saveLines (option -sl) in the scrollback buffer to reduce memory usage. [4]
    • Use tmux for scrollback buffer and set saveLines to 0
  • Disable perl
  • Consider running urxvtd as a daemon accepting connections from urxvtc clients.

デーモンクライアント

Xinitrc

man urxvtdExamples セクションを見て下さい。

systemd

ノート: systemd で起動した urxvt クライアント/デーモンにログインしているとき、通常ユーザーは systemctl の電源コマンド (reboot, poweroff など) を実行することはできません。クライアントがセッションに含まれなくなるからです。そのため systemd で urxvt を起動するのは推奨されません。

システムサービス:

/etc/systemd/system/urxvtd@.service
[Unit]
Description=RXVT-Unicode Daemon

[Service]
User=%i
ExecStart=/usr/bin/urxvtd -q -o

[Install]
WantedBy=multi-user.target

サービスを起動するときにユーザー名を指定します:

urxvtd@username.service

systemd/ユーザーサービスの場合、以下のユニットファイルを ~/.config/systemd/user に配置してください:

urxvtd.service
[Unit]
Description=Urxvt Terminal Daemon
Requires=urxvtd.socket

[Service]
ExecStart=/usr/bin/urxvtd -o -q
Environment=RXVT_SOCKET=%t/urxvtd-%H

[Install]
WantedBy=MyTarget.target
urxvtd.socket
[Unit]
Description=urxvt daemon (socket activation)
Documentation=man:urxvtd(1) man:urxvt(1)

[Socket]
ListenStream=%t/urxvtd-%H

[Install]
WantedBy=sockets.target

カットアンドペースト

ノート: With the use of a terminal multiplexer, urxvt (or any terminal emulator) 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 terminal emulator lacks the ability to distinguish between multiplexed terminals. Therefore, it would be effectively redundant for one who always uses a terminal multiplexer capable of maintaining a scrollback buffer and integrating with CLIPBOARD (e.g. tmux with customized key bindings) to integrate 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 PRIMARY selection by default. [5] 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 or Ctrl+Alt+C can be used to copy and Shift+Insert or Ctrl+Alt+V to paste.

カスタムキーバインディング

To enable copy/paste using Ctrl+Shift+c/Ctrl+Shift+v, or similar, you will need to edit your .Xresources. First add the extension:

URxvt.perl-ext-common: default,clipboard

Then disable iso14755:

URxvt.iso14755: False

And bind the keys:

URxvt.keysym.Shift-Control-C: perl:clipboard:copy
URxvt.keysym.Shift-Control-V: perl:clipboard:paste

If using xsel (which is the default), use:

URxvt.clipboard.copycmd:  xsel -ib
URxvt.clipboard.pastecmd: xsel -ob

These two settings can be changed for other clipboard managers such as xclip.

クリップボードの管理

クリップボード#クリップボードマネージャの一覧を見て下さい。

スクリプトによる自動管理

ノート: Since version 9.20, rxvt-unicode comes with a new selection-to-clipboard extension that supersedes the scripts below. Enable it like any other extension.

Skottish[6] created a Perl script to automatically copy any selection in rxvt-unicode to the X clipboard. Save the following as /usr/lib/urxvt/perl/clipboard:

#! /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" );
}

Xyne has also created his own variation of Skottish's script named urxvt-clipboardAUR which is available in the AUR that allows the user to paste the selection with Ctrl+V instead of only with a middle mouse click:

#! /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;
}

It also requires xsel and needs to be enabled in the *perl-ext-common or *perl-ext field in ~/.Xresources. For example:

URxvt.perl-ext-common: default,clipboard

The AUR package urxvt-perls-gitAUR is another option one can use. urxvt-perls-gitAUR includes the same functionality as urxvt-clipboardAUR, in addition to the keyboard-select and url-select Perl extensions.

Improved Kuake-like behavior in Openbox

以下は元は Xyne によってフォーラムに投稿されたもの [7] で、公式リポジトリにある xdotool に依存しています。

Scriptlets

Save this scriptlet from the urxvtc man page somewhere on your system as urxvtc (e.g., in ~/.config/openbox):

#!/bin/sh

urxvtc "$@"
if [$? -eq 2]; then
   urxvtd -q -o -f
   urxvtc "$@"
fi

and save this one as urxvtq:

#!/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

A previous version of 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 xdotool >= 1.20100416.2809, but it has been left here for future reference.'

#!/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

Make sure that you change /path/to/urxvtc to the actual path to the urxvtc scriptlet that you saved above. We will be using urxvtc to launch both regular instances of urxvt and the kuake-like instance.

urxvtq with tabbing

If you want to have tabs in your kuake-like urxvtc (here called urxvtq) just replace the third line in your 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 urxvtq:

/path/to/urxvtc -name urxvtq -geometry 80x28

with:

/path/to/urxvtc -name urxvtq -pe tabbed -geometry 80x28

or replace this line of your ~/.Xresources file:

URxvt.perl-ext-common: default,matcher

with

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

Tab control

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 exit like you would to normally close a terminal.

Openbox の設定

Now add the following lines to the <applications> section of ~/.config/openbox/rc.xml:

<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 <keyboard> section:

<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 /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 Super+T, and toggle the kuake-like console with 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 Openbox bindings documentation for the full range or possibilities.

The 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 urxvtq scriptlet to adjust the height of the console.

Related scripts

トラブルシューティング

~/.Xresources is not being sourced

In some cases where urxvt does not acknowledge ~/.Xresources, you may need to add xrdb -merge ~/.Xresources to your ~/.xinitrc file. See X resources for more information.

Transparency not working after upgrade to v9.09

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
  • hsetroot
  • esetroot

To make true transparency work, make sure to comment URxvt.tintColor and 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 rxvt-unicode-terminfo on the remote host or by copying /usr/share/terminfo/r/rxvt-unicode from your local machine to your host at ~/.terminfo/r/rxvt-unicode; same for rxvt-unicode-256color.

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"'

Using rxvt-unicode as gmrun terminal

Unlike some other terminals, urxvt expects the arguments to -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 .gmrunrc:

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

(gmrun uses /bin/sh to execute commands, so the "eval" is understood here.) The "eval" has the side-effect of "breaking up" the argument to -e in the same way that $@ does in Bash, making the command intelligible to urxvt.

My numerical keypad acts weird and generates differing output? (e.g. in vim)

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 (xorg-xmodmap), you can re-map your number pad keys back.

1. Check the keycode that your numerical keypad (numpad) generates using xev program.

  • Start the xev program
  • Press your number pad keys and look for ... keycode xxx ... in 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 ~/.Xmodmap, with the content representing your keycode.

Example of xmodmap file with number pad keycode:

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. Load your xmodmap file at X session start-up.

For example, in ~/.xinitrc file add:

...
xmodmap ~/.Xmodmap
...

Pseudo-tty

The following error is likely caused by /dev/pts having been mounted with the wrong options.

urxvt: can't initialize pseudo-tty, aborting.

Remove /dev/pts from /etc/fstab and fix the current mount options with:

# mount -o remount,gid=5,mode=620 /dev/pts

See also [8], FS#36548, and [9].

Key combinations do not work

See Get Alt key to work in terminal.

Slow performance when drawing glyphs

Some programs like alsamixer and xprop do not perform well with some graphics drivers and in consequence redraw very slowly. The option "skipBuiltinGlyphs" for ~/.Xresources or the command line option -sbg may fix this. One possible solution is to add the following to ~/.Xresources:

URxvt*skipBuiltinGlyphs:    true

外部資料