Difference between revisions of "Rxvt-unicode"

From ArchWiki
Jump to: navigation, search
m (Scrollback Position)
(Font declaration methods: remove nonsense on restarting X)
 
(186 intermediate revisions by 61 users not shown)
Line 1: Line 1:
 +
{{DISPLAYTITLE:rxvt-unicode}}
 
[[Category:Terminal emulators]]
 
[[Category:Terminal emulators]]
{{DISPLAYTITLE:rxvt-unicode}}
 
 
[[de:urxvt]]
 
[[de:urxvt]]
 
[[es:Rxvt-unicode]]
 
[[es:Rxvt-unicode]]
 
[[fr:urxvt]]
 
[[fr:urxvt]]
 +
[[ja:Rxvt-unicode]]
 +
[[ru:Rxvt-unicode]]
 
[[sr:Rxvt-unicode]]
 
[[sr:Rxvt-unicode]]
[http://software.schmorp.de/pkg/rxvt-unicode.html rxvt-unicode] is a highly customizable [[Wikipedia:Terminal emulator|terminal emulator]] forked from [[Wikipedia:Rxvt|rxvt]]. Commonly known as {{Ic|urxvt}}, rxvt-unicode can be [[daemon]]ized to run clients within a single [[Wikipedia:Process (computing)|process]] in order to minimize the use of system resources. Developed by Marc Lehmann, some of the more outstanding features of rxvt-unicode include international language support through [[Wikipedia:Unicode|Unicode]], the ability to display multiple font types and support for [[Wikipedia:Perl|Perl]] extensions.
+
{{Related articles start}}
 +
{{Related|rxvt-unicode/Tips and tricks}}
 +
{{Related articles end}}
 +
[http://software.schmorp.de/pkg/rxvt-unicode.html rxvt-unicode] is a customizable [[Wikipedia:Terminal emulator|terminal emulator]] forked from [[Wikipedia:Rxvt|rxvt]]. Features of rxvt-unicode include international language support through [[Wikipedia:Unicode|Unicode]], the ability to display multiple font types and support for [[Wikipedia:Perl|Perl]] extensions.
  
==Installation==
+
== Installation ==
  
{{Pkg|rxvt-unicode}} is available in the [[Official Repositories|official repositories]] and includes 256 color support.
+
[[Install]] the {{Pkg|rxvt-unicode}} package.
  
{{AUR|rxvt-unicode-patched}} is available in the [[AUR]] and includes a fix for the font width bug.
+
== Configuration ==
  
==Configuration==
+
See [http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.1.pod urxvt(1)] and [http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod urxvt(7)] for available settings and values.
See the [http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.1.pod rxvt-unicode reference page] for the complete list of available setting and values.
+
  
===Creating ~/.Xresources===
+
=== Xresources ===
The look, feel, and function of rxvt-unicode is controlled by command-line arguments and/or [[X resources]]. X resources can be set using {{ic|~/.Xresources}} and xrdb ({{Pkg|xorg-xrdb}}), see the [[X_resources|wiki page]] for details.
+
  
{{Note|Command-line arguments override, and take precedence over resource settings}}
+
Rxvt-unicode is controlled by command-line arguments or [[Xresources]]. Command-line arguments override, and take precedence over resource settings See the [[X resources]] article for details.
 
+
===True transparency===
+
 
+
To use true transparency, you need to be using a [[Window_Manager|window manager]] that supports compositing or a separate compositor.
+
 
+
From the command-line:
+
 
+
$ urxvt -depth 32 -bg rgba:3f00/3f00/3f00/dddd
+
 
+
Using the configuration file:
+
 
+
{{hc|~/.Xresources|
+
URxvt.depth: 32
+
URxvt.background: rgba:1111/1111/1111/dddd
+
}}
+
 
+
or
+
 
+
{{hc|~/.Xresources|
+
URxvt.depth: 32
+
URxvt.background: [95]#000000
+
}}
+
 
+
where '95' is the opacity level in percentage and '#000000' is the background color.
+
{{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}}.}}
+
 
+
===Native transparency===
+
 
+
If there is no need for true transparency, or if compositing uses too many resources on your system, you can get transparency working in the following way:
+
{{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.}}
+
  
===Scrollbar===
+
{{ic|urxvt --help}} prints all available ''rxvt'' resources to standard error. The man page has full explanations of each resource.
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:
+
=== Scrollback position ===
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}}:
 
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}}:
  
Line 79: Line 39:
 
  URxvt*scrollTtyKeypress: true
 
  URxvt*scrollTtyKeypress: true
  
===Font Declaration Methods===
+
=== Scrollback buffer in secondary screen ===
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:
+
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.
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 {{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.
+
In urxvt, to disable the scrollback buffer for the ''secondary screen'':
  
{{Note|The above paragraph is only for bitmap fonts. Xft fonts can be specified using the following format:}}
+
URxvt.secondaryScreen: 1
  URxvt.font: xft:monaco:size=10
+
  URxvt.secondaryScroll: 0
  
Or
+
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.font: xft:monaco:bold:size=10
+
  
===Set icon===
+
  URxvt.secondaryWheel: 1
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:
+
  URxvt.iconFile:   /usr/share/icons/Clarity/scalable/apps/terminal.svg
+
  
===Set as Login Shell===
+
{{Note|Avoid using this option with the {{AUR|urxvt-vtwheel}} perl extension, as it will conflict.}}
This will cause the shell to be started as a login shell, like the option {{ic|-ls}}.
+
URxvt*loginShell: true
+
  
===Set TERM===
+
=== Font declaration methods ===
Sets $TERM to a specific terminal, like the option {{ic|-tn}}.
+
URxvt*termName:screen-256color
+
  
==Perl extensions==
+
  URxvt.font: 9x15
===Clickable URLs===
+
is the same as:
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.font: -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-1
  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:
+
And, for the same font in bold:
URxvt.keysym.C-Delete:  perl:matcher:last
+
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.font: 9x15bold
  URxvt.colorUL: #4682B4
+
  
===Yankable URLs (No Mouse)===
+
is the same as:
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|official repositories]] and adjust your {{ic|.Xresources}} as necessary. An example is shown below:
+
  URxvt.font: -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-1
  URxvt.perl-ext:     default,url-select
+
URxvt.keysym.M-u:    perl:url-select:select_next
+
URxvt.url-select.launcher:  /usr/bin/firefox -new-tab
+
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.}}
+
The complete list of short names for X core fonts can be found in {{ic|/usr/share/fonts/misc/fonts.alias}} (there is 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 are probably better off avoiding them and choosing fonts by their full long names instead.
  
'''Key commands:'''
+
{{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
  
{{Keypress|Alt+U}} Enter selection mode. The last URL on your screen will be selected. You can repeat {{Keypress|Alt+U}} to select the next upward URL.
+
Or
  
{{Keypress|K}} Select next upward URL
+
URxvt.font: xft:monaco:bold:size=10
  
{{Keypress|J}} Select next downward URL
+
{{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}}
  
{{Keypress|Return}} Open selected URL in browser and quit selection mode
+
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:
  
{{Keypress|O}} Open selected URL in browser without quitting selection mode
+
$ printf '\e]710;%s\007' "xft:Terminus:pixelsize=12"
  
{{Keypress|Y}} Copy (yank) selected URL and quit selection mode
+
=== Font spacing ===
  
{{Keypress|Esc}} Cancel URL selection mode
+
By default the distance between characters can feel too wide. The spacing can be reduced by one pixel as such:
  
===Tabs===
+
{{hc|~/.Xresources|<nowiki>
To add tabs to urxvt, add the following to your {{ic|~/.Xresources}}:
+
URxvt.letterSpace: -1
URxvt.perl-ext-common: default,tabbed
+
</nowiki>}}
  
To control tabs use:
+
There is some debate [http://lists.schmorp.de/pipermail/rxvt-unicode/2007q4/000511.html][http://lists.schmorp.de/pipermail/rxvt-unicode/2007q4/000512.html] over how ''urxvt'' calculates character widths. {{AUR|rxvt-unicode-patched}} changes this calculation, usually resulting in tighter character spacing.
  
{{Keypress|Shift+ ↓}} new tab
+
=== Colors ===
  
{{Keypress|Shift+ ←}} go to left tab
+
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).
  
{{Keypress|Shift+ →}} go to right tab
+
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 [[#Xresources]] for details.
  
{{Keypress|Ctrl+ ←}} move tab to the left
+
{{Note|By default {{ic|urxvt}} uses the same colors as [[Xterm]], except one. Add {{ic|URxvt.color12: rgb:5c/5c/ff}} to Xresources to change this.}}
  
{{Keypress|Ctrl+ →}} move tab to the right
+
== Cut and paste ==
  
{{Keypress|Ctrl+D}}: close tab
+
You can use CTRL-ALT-C and CTRL-ALT-V for copy and paste.
  
You can change the colors of tabs with the following:
+
Rxvt-unicode uses cut buffers which are loaded into the current {{Ic|PRIMARY}} selection by default. See [http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.1.pod#THE_SELECTION_SELECTING_AND_PASTING_ Selecting and pasting text] for details.
URxvt.tabbed.tabbar-fg: 2
+
URxvt.tabbed.tabbar-bg: 0
+
URxvt.tabbed.tab-fg:    3
+
URxvt.tabbed.tab-bg:    0
+
  
For named tabs, see {{AUR|urxvt-tabbedex}}, ({{Keypress|Shift+ ↑}}: names a tab).
+
{{Note|Text can be selected to {{ic|CLIPBOARD}} with the {{ic|selection-to-clipboard}} [[#Perl extensions|perl extension]] available since {{Pkg|rxvt-unicode}} 9.20.}}
  
===Fullscreen===
+
See also [[Clipboard#List of clipboard managers]]
  
You can install the [[AUR]] package {{AUR|urxvt-fullscreen}}, and then set a key binding to put urxvt fullscreen.
+
== Perl extensions ==
  
{{hc|~/.Xresources|
+
{{Style|Bias towards url-select while matcher and url-select are mostly equivalent, as well as man page duplication}}
...
+
URxvt.perl-ext-common: ..., fullscreen, ...
+
URxvt.keysym.F11: perl:fullscreen:switch
+
...
+
}}
+
  
===Scrollwheel Support===
+
We can enable URxvt perl extensions by including the following line:
  
Install {{AUR|urxvt-vtwheel}} from the [[AUR]] and add it to your Perl extensions within {{ic|~/.Xresources}}:
+
  URxvt.perl-ext-common: extension_name_1,extension_name_2,...
  
  URxvt.perl-ext-common:  ...,vtwheel,...
+
Please take note that there '''should not''' be any spacing between extension names.
  
===Disabling Perl extensions===
+
=== Clickable URLs ===
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:
+
  
==Colors==
+
You can make URLs in the terminal clickable using the matcher extension. For example, to open links in the default web browser with the left mouse button, add the following to {{ic|.Xresources}}:
Colors must be specified using color indexes: 0 to 15 correspond with the colors from the rxvt manual "Colors and Graphics" Section.
+
{{bc|1=COLORS AND GRAPHICS
+
  
If graphics support was enabled at compile-time, rxvt can be queried with ANSI escape sequences and can address individual pixels instead of text
+
URxvt.perl-ext-common: default,matcher
characters. Note the graphics support is still considered beta code.
+
URxvt.url-launcher: /usr/bin/xdg-open
 +
URxvt.matcher.button: 1
  
In addition to the default foreground and background colours, rxvt can display up to 16 colours (8 ANSI colours plus high-intensity bold/blink
+
Since rxvt-unicode 9.14, it's also possible to use matcher to open and list recent (currently limited to 10) URLs via keyboard:
versions of the same). Here is a list of the colours with their rgb.txt names.
+
  
color0 (black) = Black
+
URxvt.keysym.C-Delete: perl:matcher:last
color1 (red)         = Red3
+
URxvt.keysym.M-Delete: perl:matcher:list
color2 (green) = Green3
+
color3 (yellow) = Yellow3
+
color4 (blue)         = Blue3
+
color5 (magenta) = Magenta3
+
color6 (cyan)         = Cyan3
+
color7 (white) = AntiqueWhite
+
color8 (bright black) = Grey25
+
color9 (bright red) = Red
+
color10 (bright green) = Green
+
color11 (bright yellow) = Yellow
+
color12 (bright blue) = Blue
+
color13 (bright magenta)= Magenta
+
color14 (bright cyan) = Cyan
+
color15 (bright white) = White
+
foreground = Black
+
background = White
+
  
It is also possible to specify the colour values of foreground, background, cursorColor, cursorColor2, colorBD, colorUL as a number 0-15, as a
+
Matching links can be colored with a chosen foreground or background [[#Colors|color]], for example blue:
convenient shorthand to reference the colour name of color0-color15.
+
  
Note that -rv ("reverseVideo: True") simulates reverse video by always swapping the foreground/background colours. This is in contrast to xterm(1)
+
URxvt.matcher.rend.0: Uline Bold fg5
where the colours are only swapped if they have not otherwise been specified. For example,
+
  
rxvt -fg Black -bg White -rv
+
Alternatively, use {{ic|colorUL}} for a #RRGGBB color. This will however color all underlined text, instead of only link matches:
    would yield White on Black, while on xterm(1) it would yield Black on White.
+
}}
+
URxvt.colorUL: #4682B4
  
==Improving Performance==
+
=== Yankable URLs (no mouse) ===
*Avoid the use of Xft fonts. If Xft fonts must be used, append {{Ic|<nowiki>:antialias=false</nowiki>}} to the setting value.<sup>[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod#Can_I_speed_up_Xft_rendering_somehow]</sup>
+
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:
 +
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
  
*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]</sup>
+
{{Note|This extension replaces the Clickable URLs extension mentioned above, so {{Ic|matcher}} can be removed from the {{Ic|URxvt.perl-ext}} list.}}
  
*Limit the number of {{Ic|saveLines}} (option {{Ic|-sl}}) in the scrollback buffer to reduce memory usage.<sup>[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod#Isn_t_rxvt_unicode_supposed_to_be_sm]</sup>
+
'''Key commands:'''
  
*Consider running {{Ic|urxvtd}} as a daemon accepting connections from {{Ic|urxvtc}} clients.
+
{| class="wikitable"
 +
! Key !! Description
 +
|-
 +
| 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
 +
|-
 +
| 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
 +
|}
  
==Cut and Paste==
+
=== Simple tabs ===
{{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.<sup>[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.1.pod#THE_SELECTION_SELECTING_AND_PASTING_]</sup> Users are urged to review [[Wikipedia:X Window selection]] for additional information.
+
To add tabs to urxvt, add the following to your {{ic|~/.Xresources}}:
====Default Key Bindings====
+
URxvt.perl-ext-common: ...,tabbed,...
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.
+
====Clipboard Management====
+
* [http://parcellite.sourceforge.net/ Parcellite] is a GTK+ clipboard manager which can also run in the background as a daemon.
+
  
* [http://www.nongnu.org/autocutsel/ autocutsel] provides command line and daemon interfaces to synchronize PRIMARY, {{Ic|CLIPBOARD}} and cut buffer selections.
+
To control tabs use:
  
* [http://glipper.sourceforge.net/ Glipper] is a [[GNOME]] panel applet with older versions available for use in environments other than GNOME.
+
{| class="wikitable"
 +
! Key !! Description
 +
|-
 +
| Shift+Down || New tab
 +
|-
 +
| Shift+Left || Go to left tab
 +
|-
 +
| Shift+Right || Go to right tab
 +
|-
 +
| Ctrl+Left || Move tab to the left
 +
|-
 +
| Ctrl+Right || Move tab to the right
 +
|-
 +
| Ctrl+d || Close tab
 +
|}
  
* [http://goodies.xfce.org/projects/panel-plugins/xfce4-clipman-plugin Clipman] (xfce-clipman-plugin) is a GUI clipboard manager plugin for the [[Xfce]] panel (xfpanel).
+
You can change the colors of tabs with the following:
  
* [http://sourceforge.net/projects/xclip/ xclip] is a lightweight, command-line based interface to the clipboard.
+
URxvt.tabbed.tabbar-fg: 2
 +
URxvt.tabbed.tabbar-bg: 0
 +
URxvt.tabbed.tab-fg: 3
 +
URxvt.tabbed.tab-bg: 0
  
====Automatic Script Management====
+
=== Fullscreen ===
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 {
+
You can install the [[AUR]] package {{AUR|urxvt-fullscreen}}, and then set a key binding to put urxvt fullscreen.
    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 {{Keypress|Ctrl+V}} instead of only with a middle mouse click:
+
{{bc|<nowiki>
+
#! /usr/bin/perl
+
  
sub on_sel_grab
+
{{hc|~/.Xresources|
{
+
...
  my $query = $_[0]->selection;
+
URxvt.perl-ext-common: ...,fullscreen,...
  open (my $pipe,'|-','xsel -ib') or die;
+
URxvt.keysym.F11: perl:fullscreen:switch
  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<sup>[https://bbs.archlinux.org/viewtopic.php?pid=550380]</sup>, and it relies on the {{Pkg|xdotool}} found in the [[Official Repositories|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}}:
+
=== Changing font size on the fly ===
{{bc|<nowiki>
+
#!/bin/bash
+
  
wid=$(xdotool search --classname urxvtq)
+
Install {{AUR|urxvt-resize-font-git}} from the [[AUR]], add it to your Perl extensions within {{ic|~/.Xresources}}
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.
+
  URxvt.perl-ext-common:  ...,resize-font,...
{{bc|<nowiki>
+
#!/bin/bash
+
  
wid=$(xprop -name urxvtq | grep 'WM_COMMAND' | awk -F ',' '{print $3}' | awk -F '"' '{print $2}')
+
and add some key bindings, for example like this:
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.
+
  URxvt.resize-font.smaller: C-Down
 +
  URxvt.resize-font.bigger: C-Up
  
===urxvtq with tabbing===
+
For the 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]):
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}}:
+
  URxvt.iso14755: false
/path/to/urxvtc -name urxvtq -geometry 80x28
+
  URxvt.iso14755_52: false
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====
+
=== Disabling Perl extensions ===
{{Keypress|Shift+ ←}}: Switch to the tab left of the current one
+
  
{{Keypress|Shift+ →}}: Switch to the tab right of the current one
+
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:
  
{{Keypress|Shift+ ↓}}: Create a new tab
+
{{Note|If you use multiple Perl extension features, you can list them in succession, comma-separated: {{ic|URxvt.perl-ext-common:default,matcher,tabbed.}}}}
  
You can also use your mouse to switch the tabs by clicking the wished one and create a new tab by clicking on ''[NEW].\\''
+
== Troubleshooting ==
  
To close a tab just enter {{Ic|exit}} like you would to normally close a terminal.
+
=== Transparency not working after upgrade to v9.09 ===
  
===Openbox configuration===
+
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:
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 {{keypress|Super+T}}, and toggle the kuake-like console with {{keypress|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.
 
 
==Troubleshooting==
 
===~/.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===
 
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]]
 
* hsetroot
 
* hsetroot
Line 434: Line 249:
 
To make true transparency work, make sure to comment URxvt.tintColor and URxvt.inheritPixmap.
 
To make true transparency work, make sure to comment URxvt.tintColor and URxvt.inheritPixmap.
  
===Remote Hosts===
+
=== Remote hosts ===
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 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.
+
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.
  
 
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:
 
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===
+
=== Using rxvt-unicode as gmrun terminal ===
 +
 
 
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}}:
 
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}}:
  
Line 456: Line 273:
  
 
1. Check the keycode that your numerical keypad (numpad) generates using {{ic|xev}} program.
 
1. Check the keycode that your numerical keypad (numpad) generates using {{ic|xev}} program.
:* Start the {{ic|xev}} program
+
 
:* 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''''.
+
* Start the {{ic|xev}} program
 +
* 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. Create or modify your xmodmap file, usually {{ic|~/.Xmodmap}}, with the content representing your keycode.
  
:Example of xmodmap file with number pad keycode,
+
Example of xmodmap file with number pad keycode:
 +
 
 
{{bc|1=
 
{{bc|1=
 
keycode 63 = KP_Multiply
 
keycode 63 = KP_Multiply
Line 483: Line 302:
 
3. Load your xmodmap file at X session start-up.
 
3. Load your xmodmap file at X session start-up.
  
:For example, in {{ic|~/.xinitrc}} file add,
+
For example, in {{ic|~/.xinitrc}} file add:
 +
 
 
  ...
 
  ...
 
  xmodmap ~/.Xmodmap
 
  xmodmap ~/.Xmodmap
 
  ...
 
  ...
  
==External resources==
+
=== Key combinations do not work ===
*[http://software.schmorp.de/pkg/rxvt-unicode.html rxvt-unicode] - Official site
+
 
*[http://cvs.schmorp.de/rxvt-unicode/ Source Code] - Browseable CVS
+
See [http://vim.wikia.com/wiki/Get_Alt_key_to_work_in_terminal?useskin=monobook Get Alt key to work in terminal].
*[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod rxvt-unicode FAQ] - Official FAQ
+
 
*[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.1.pod rxvt-unicode Reference] - Official manual page
+
=== Slow performance when drawing glyphs ===
*[http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/src/urxvt.pm urxvtperl] - Official Perl extension reference
+
 
 +
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}}:
 +
 
 +
URxvt*skipBuiltinGlyphs:    true
 +
 
 +
=== Very long lines cause slowdown ===
 +
 
 +
The {{ic|matcher}} plugin may be the culprit here. It must match a regex against a line every time the line updates, and if you have a large {{ic|saveLines}} value this can exacerbate the problem by allowing a very large maximum line length.
 +
 
 +
There are some simple workarounds:
 +
 
 +
* Reduce {{ic|saveLines}}
 +
* Disable the {{ic|matcher}} plugin
 +
 
 +
If neither of those are palatable options, you can compromise by disabling URL matching past a certain cutoff point:
 +
 
 +
# Copy {{ic|/usr/lib/urxvt/perl/matcher}} to {{ic|~/.urxvt/ext/}} (creating the directory if necessary)
 +
# Edit {{ic|~/.urxvt/ext/matcher}}, and find the {{ic|<nowiki>my ($self, $row) = @_;</nowiki>}} line in the {{ic|on_line_update}} sub. It should be line 270.
 +
# After that line, insert the line {{ic|return () if $row < -100;}}. This disables URL matching on any line that starts more than 100 rows behind the top of the terminal.
 +
 
 +
== See also ==
 +
 
 +
* [http://software.schmorp.de/pkg/rxvt-unicode.html rxvt-unicode] - Official site
 +
* [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] - Official 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/src/urxvt.pm urxvtperl] - Official Perl extension reference

Latest revision as of 12:20, 13 September 2016

rxvt-unicode is a customizable terminal emulator forked from rxvt. Features of rxvt-unicode include international language support through Unicode, the ability to display multiple font types and support for Perl extensions.

Installation

Install the rxvt-unicode package.

Configuration

See urxvt(1) and urxvt(7) for available settings and values.

Xresources

Rxvt-unicode is controlled by command-line arguments or Xresources. Command-line arguments override, and take precedence over resource settings See the X resources article for details.

urxvt --help prints all available rxvt resources to standard error. The man page has full explanations of each resource.

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
Note: Avoid using this option with the urxvt-vtwheelAUR perl extension, as it will conflict.

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 is 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 are probably better off avoiding them and choosing fonts by their full long names instead.

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

Or

URxvt.font: xft:monaco:bold:size=10
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

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"

Font spacing

By default the distance between characters can feel too wide. The spacing can be reduced by one pixel as such:

~/.Xresources
URxvt.letterSpace: -1

There is some debate [2][3] over how urxvt calculates character widths. rxvt-unicode-patchedAUR changes this calculation, usually resulting in tighter character spacing.

Colors

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).

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 #Xresources for details.

Note: By default urxvt uses the same colors as Xterm, except one. Add URxvt.color12: rgb:5c/5c/ff to Xresources to change this.

Cut and paste

You can use CTRL-ALT-C and CTRL-ALT-V for copy and paste.

Rxvt-unicode uses cut buffers which are loaded into the current PRIMARY selection by default. See Selecting and pasting text for details.

Note: Text can be selected to CLIPBOARD with the selection-to-clipboard perl extension available since rxvt-unicode 9.20.

See also Clipboard#List of clipboard managers

Perl extensions

Tango-edit-clear.pngThis article or section needs language, wiki syntax or style improvements.Tango-edit-clear.png

Reason: Bias towards url-select while matcher and url-select are mostly equivalent, as well as man page duplication (Discuss in Talk:Rxvt-unicode#)

We can enable URxvt perl extensions by including the following line:

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

Please take note that there should not be any spacing between extension names.

Clickable URLs

You can make URLs in the terminal clickable using the matcher extension. For example, to open links in the default web browser with the left mouse button, add the following to .Xresources:

URxvt.perl-ext-common: default,matcher
URxvt.url-launcher: /usr/bin/xdg-open
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

Yankable URLs (no mouse)

In addition, you can select and open URLs in your web browser without using the mouse. Install the urxvt-perls package from the official repositories and adjust your .Xresources as necessary. An example is shown below:

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
Note: This extension replaces the Clickable URLs extension mentioned above, so matcher can be removed from the URxvt.perl-ext list.

Key commands:

Key Description
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

Simple tabs

To add tabs to urxvt, add the following to your ~/.Xresources:

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

To control tabs use:

Key Description
Shift+Down New tab
Shift+Left Go to left tab
Shift+Right Go to right tab
Ctrl+Left Move tab to the left
Ctrl+Right Move tab to the right
Ctrl+d Close tab

You can change the colors of tabs with the following:

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

Fullscreen

You can install the AUR package urxvt-fullscreenAUR, and then set a key binding to put urxvt fullscreen.

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

Changing font size on the fly

Install urxvt-resize-font-gitAUR from the AUR, add it to your Perl extensions within ~/.Xresources

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

and add some key bindings, for example like this:

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

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

 URxvt.iso14755: false
 URxvt.iso14755_52: false

Disabling Perl extensions

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:
Note: If you use multiple Perl extension features, you can list them in succession, comma-separated: URxvt.perl-ext-common:default,matcher,tabbed.

Troubleshooting

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.

Remote hosts

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

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

Very long lines cause slowdown

The matcher plugin may be the culprit here. It must match a regex against a line every time the line updates, and if you have a large saveLines value this can exacerbate the problem by allowing a very large maximum line length.

There are some simple workarounds:

  • Reduce saveLines
  • Disable the matcher plugin

If neither of those are palatable options, you can compromise by disabling URL matching past a certain cutoff point:

  1. Copy /usr/lib/urxvt/perl/matcher to ~/.urxvt/ext/ (creating the directory if necessary)
  2. Edit ~/.urxvt/ext/matcher, and find the my ($self, $row) = @_; line in the on_line_update sub. It should be line 270.
  3. After that line, insert the line return () if $row < -100;. This disables URL matching on any line that starts more than 100 rows behind the top of the terminal.

See also