Hot answers tagged

49

What is $TERM for? The $TERM variable is for use by applications to take advantage of capabilities of that terminal. For example, if a program want's to display colored text, it must first find out if the terminal you're using supports colored text, and then if it does, how to do colored text. The way this works is that the system keeps a library of known ...


27

The TERM environment variable indicates the terminal type, not the terminal application. TERM has a specific purpose: it tells applications running in that terminal how to interact with the terminal. Applications interact with terminals by writing escape sequences — sequences of characters that include nonprintable characters and have effects such as moving ...


20

The TERM environment variable should be set by the application that is acting as your terminal. This is the whole point of the thing: letting programs running inside them know what terminal is being used and hence what sort of features it supports. Zsh is not a terminal. It is a shell. It might care what your TERM is set to if it wants to do special things, ...


19

Yes, finally found my mistake. It seems like you need to install the package rxvt-unicode-256color to get 256 color support. sudo apt-get install rxvt-unicode-256color is the answer to my problems.


19

X11 uses two buffers: PRIMARY and CLIPBOARD. To copy/paste to the CLIPBOARD buffer you can often use CTRL-C and CTRL-V. You can insert to the PRIMARY buffer by selecting a text and paste from it by pressing the middle mouse button. If you want to use the CLIPBOARD buffer, put this in your ~/.Xresources file and use Ctrl+Shift+C and Ctrl+Shift+V to copy/...


18

The TERM environment variable is a way that you, the user, can tell programs (e.g., emacs, grep, less, ls, and vim) what kind of terminal they are running on, so they will know its parameters, including what capabilities it has and what escape sequences they need to issue to access them.  This exists because it’s too hard, in general, for the software to ...


17

You do it with X resources. I have a file, .Xresources, that contains these xterm-related resources: XTerm*VT100.cutNewLine: false XTerm*VT100.cutToBeginningOfLine: false XTerm*VT100.charClass: 33:48,35:48,37:48,42:48,45-47:48,64:48,95:48,126:48 In my .xinitrc file, I have some line that merge in those resources: if [ -f $userresources ]; then /usr/...


17

A long time ago, there was a window manager called twm—actually, it still exists and runs perfectly well. Instead of minimizing a window to a bar at the bottom of the screen (or similar) like MS Windows, Mac OS X, and many modern window managers, it shrunk them to labeled icons ("iconfify"). The Wikipedia twm article has some nice pictures, such as: The ...


16

The appres utility lists the resources used by an application, both user and default. appres XTerm xterm The first argument is the class name (xterm -class Xxx). The second argument, which is optional, is the instance name (xterm -name xxx). The “Large” font is .VT100.font5 or .VT100.utf8Fonts.font5. See the manual for whether .utf8Fonts is used, it's a ...


15

Problem solved! To enable native xterm mouse scrolling in tmux, a lot of wiki, Q & A site, blog post suggest adding a line like: set -g terminal-overrides 'xterm*:smcup@:rmcup@' to ~/.tmux.conf. And it is the culprit. To allow xterm titles in terminal window, you also need to add the XT flag, something like this: set -g terminal-overrides "xterm*:XT:...


15

256-colour test pattern For the above, you can use my bash code. ("Look Ma, no subprocesses!") Or for a bash quicky: for i in {0..255} ; do printf "\x1b[38;5;${i}m%3d " "${i}" if (( $i == 15 )) || (( $i > 15 )) && (( ($i-15) % 12 == 0 )); then echo; fi done 24-bit / truecolour test pattern See this question for the full ...


14

The value of the environment variable TERM is used by the server (in system V, or BSD, derived OSes) to control how input is recognized by the system, and what capabilities exist for output. Some terminal types are similar enough that they can be interchanged while still remaining usefull, while others could make the system unusable until you open a new ...


14

It is not necessary to modify the xterm translations resources to copy data to/from Firefox, unless you prefer to use the keyboard to help with the process. Since 2006 xterm has a feature selectToClipboard which lets you switch between the PRIMARY selection (standard) and CLIPBOARD (Firefox, etc). Because some programs do use the primary selection, and ...


13

Xterm is configured via X resources. This is how you might configure it for white on black, with a lighter blue than the default (adjust the color as you see fit, obviously): XTerm.VT100.background: Black XTerm.VT100.color0: Black XTerm.VT100.color1: Red XTerm.VT100.color2: Green XTerm.VT100.color3: ...


13

The feature seems to be called 'alternate screen' or switching between normal and alternate screen. You can explore it using an xterm. For example type man man in an xterm and exit man. Now you can switch to the alternate screen via Ctrl+Mouse2 (middle click) -> 'Show alternate screen'. Alternatively you can directly enter the xterm control sequences, e.g.: ...


12

Something that runs inside GNU screen decided it was running in an xterm (or similar) instead and enabled Application Mouse mode. (Or something you run in that terminal before you attached to GNU screen, possibly even before ssh, which did not properly reset itself.) This is often the case if $TERM is not “screen” but e.g. “xterm” or “screen.xterm”. The ...


12

The environment variable TERM does not mean the terminal you are using. Quoting gnu.org: The environment variable TERM contains a identifier for the text window's capabilities. You can get a detailed list of these cababilities by using the > ‘infocmp’ command, using ‘man 5 terminfo’ as a reference. When producing text with embedded color ...


11

The mapping from keyboard keys to modifiers like Meta and Control is handled by the X server (i.e. the low-level part of the GUI). This mapping can be manipulated through the old-style xmodmap command or the new-style XKB interface, or through a GUI configuration tools that uses one of these under the hood. By default, on most setups, the Meta key is the ...


11

ls don't outputs colors by default, usually it is an alias to ls --color=auto setted in .bashrc. Check if you're invoking ls directly or through an alias with type ls. If it outputs ls is /bin/ls maybe your .bashrc wasn't loaded when you created the tmux session. If so, try to reload it with source ~/.bashrc.


11

If using bash, the following should do the trick: TOLASTLINE=$(tput cup "$LINES") PS1="\[$TOLASTLINE\]$PS1" Or (less efficient as it runs one tput command before each prompt, but works after the terminal window has been resized): PS1='\[$(tput cup "$LINES")\]'$PS1 To prevent tput from changing the exit code, you can explicitly save and reset it: PS1='\[$...


10

You have hinted the answer yourself by referencing https://en.wikipedia.org/wiki/Fixed_(typeface) This is the standard fixed bitmap font which has been expanded by Markus Kuhn to have a rather complete character set. The question is then how to scale a bitmap. What you have achieved so far is scaling a vector font and converting it to a bitmap (ttf → bdf → ...


9

Add -t to your ssh. By default when you pass a command to ssh, it doesn't allocate a TTY on the remote host, so the application only has a basic STDOUT pipe to work with. ssh -t foobar 'watch -t -d -n 1 "netstat -veeantpo | grep 43597"'


9

If you meant to distinguish interactive from noninteractive shells, use test's inbuilt support for detecting it (not sure if ksh has it, but the binary from coreutils supports it too): test -t 0 # will return 0 for interactive shells If you really meant whether you're on a tty/pty/pts or something else, parse the output from tty: $ tty # konsole /dev/pts/...


9

This is probably the urgency hint which can be set on windows. This hint is recognized by most window managers. Most terminals can be configured to set the urgency hint when receiving a bell. (u)xterm for example has the bellIsUrgent option and (u)rxvt has urgentOnBell. To ring the bell in a terminal just run tput bel or echo "\a" (depending on the shell ...


9

reset has its place, but clears your screen. If you are running xterm or anything compatible, the shortest, least intrusive thing to use would be printf '\033[?9l' That is not explicitly stated in the Mouse Tracking section of XTerm Control Sequences, but xterm allows you to reset (disable) mouse mode by turning off any of the possible modes that might be ...


9

Update: It's nVidia Stephen Dowdy responded to the Debian bug report and suggested it may be an nVidia bug. where it is corrupting signal masks. Some searching found Debian Bug #728743, and indeed switching to Nouveau/MESA (the open-source driver) has fixed the problem. Note that downgrading to an older nVidia driver did not, which likely means that its ...


9

you don't see actual terminals all that often anymore, but for instance the Linux text consoles on (CTRL +) ALT + F1 through F6 are considered terminals. xterm is a terminal emulator for systems running the x-window system and a graphical user interface. It provides only a single terminal, typically running a single process (an interactive shell by default)....


9

X11 resources have a name which consists of a series of components separated by a dot, such as xterm.vt100.geometry. The first component is the name of the application, the second component is a widget in that application, and the last component is a property of the widget. Widgets can be nested, so there can be more than three components, or just two for a ...


9

FreeBSD's termcap definition for "xterm" omits the alternate-screen escape sequence. That's been discussed here before. You could do some workaround such as (since they left the rxvt entry alone): #!/bin/sh TERM=rxvt tput ti less "$@" TERM=rxvt tput te which will "work" since rxvt uses the xterm escape sequence for this case. Simply setting TERM=rxvt in ...


8

According to the PuTTY user manual this should be enabled by default: If you have an application which is supposed to use 256-colour mode and it isn't working, you may find you need to tell your server that your terminal supports 256 colours. On Unix, you do this by ensuring that the setting of TERM describes a 256-colour-capable terminal. You can check ...


Only top voted, non community-wiki answers of a minimum length are eligible