fbterm


a fast FrameBuffer based TERMinal emulator for linux

FbTerm is a fast terminal emulator for linux with frame buffer device or VESA video card. Features include:

  • mostly as fast as terminal of linux kernel while accelerated scrolling is enabled
  • select font with fontconfig and draw text with freetype2, same as Qt/Gtk+ based GUI apps
  • dynamically create/destroy up to 10 windows initially running default shell
  • record scroll-back history for every window
  • auto-detect text encoding with current locale, support double width scripts like Chinese, Japanese etc
  • switch between configurable additional text encodings with hot keys on the fly
  • copy/past selected text between windows with mouse when gpm server is running
  • change the orientation of screen display, a.k.a. screen rotation
  • lightweight input method framework with client-server architecture
  • background image for eye candy

News

[2010-10-06] Release version 1.7

  1. added redirecting /dev/tty0 output to FbTerm's sub-window
  2. added option "ambiguous-wide" to treat ambiguous CJK characters as wide width
  3. added option "font-height" to force font height
  4. added shortcut CTRL_ALT_K to kill the frozen IM server
  5. fixed a bug where curses line drawing characters give inverted questions marks
  6. fixed a text auto selection bug
  7. fixed a logical error in terminal insert mode
  8. fixed a few other bugs

From version 1.7, FbTerm redirects /dev/tty0 output to the pseudo terminal of current sub-window. In linux before version 2.6.10, anybody can do this as long as the output was not redirected yet; since version 2.6.10, only root or a process with the CAP_SYS_ADMIN capability may do this.

In a number of CJK encodings there are ambiguous width characters which have a width of either narrow or wide depending on the context of their use. By default, FbTerm treats them as narrow width characters, the new added option "ambiguous-wide" may be used to change the behavior.

[2009-11-14] Release version 1.6

  1. added VESA video card support
  2. added rendering messages for IM server development
  3. fixed a bug where Ctrl+Space is a shortcut even user run FbTerm without "input-method" option
  4. fixed a bug where user compile FbTerm without gpm mouse support but run it in a gpm server enabled environment
  5. fixed a IM program dead loop bug triggered by FbTerm's crash
  6. fixed several spelling errors in FbTerm's help message and man-page

From version 1.6, FbTerm adds VESA video card support. By default, FbTerm tries frame buffer device first, if failure, then tries to use VESA device with highest resolution and color depth. option "vesa-mode" may be given to force only open VESA device with the specified video mode. To see available video modes for your VESA card, execute 'fbterm --vesa-mode=list'.

VESA support requires root privilege to work, and user don't force to use VESA device on the system with frame buffer device enabled, they maybe conflict with each other.

[2009-04-26] Release version 1.5

  1. added support for text rendering with background image
  2. added command-line arguments to customize command executed in sub-window
  3. added Alt-Fn and all FbTerm's shortcuts support when input method is active
  4. added option "-v/--verbose" to show some useful information
  5. fixed some text color issues with version 1.4
  6. fixed encoding selection error when locale is C/POSIX
  7. fixed a bug where screen is cleared on startup even in inactive tty
  8. fixed a bug where variable HOME is not defined

From version 1.5, user can execute FbTerm with fbterm [options] [--] [command [arguments]]. Normally FbTerm checks the SHELL variable. If that is not set, it tries to use the user's login shell program specified in the password file. If that is not set, /bin/sh will be used. command [arguments] may be given to override the built-in choice of shell program. You should use the -- argument to separate FbTerm's options from the arguments supplied to the command.

Background image support has been added in this version. FbTerm doesn't load and parse any image file with various formats directly, instead it takes a screenshot of frame buffer device on startup if variable FBTERM_BACKGROUND_IMAGE is defined, then uses this screenshot as the background for text rendering. In order to enable background image support, user should first put a image to frame buffer device with a image viewer. The updated FbTerm's man page contains a demo script using fbv. Here is a screenshot:

http://fbterm.googlecode.com/files/fbterm-with-background-images.png

[2009-03-14] Release version 1.4

  1. improved text rendering performance
  2. added private escape sequences for 256 color mode support
  3. added a option "font-width" to adjust character cell width
  4. added support for older 2.2/2.4 kernel
  5. fixed a crash bug with bitmap fonts
  6. fixed a configure failure in cross-compiling environment

xterm has a http://www.frexx.de/xterm-256-notes/'>256 color mode extension, FbTerm also add it in this version. But xterm's 256 color escape sequences conflict with the linux sequences implemented by FbTerm, so private escape sequences were introduced to support this feature:

ESC [ 1 ; n }                   set foreground color to n (0 - 255)

ESC [ 2 ; n } set background color to n (0 - 255)
ESC [ 3 ; n ; r ; g ; b } set color n to (r, g, b) , n, r, g, b all in (0 - 255)

and a new terminfo database entry named "fbterm" was added to use these private sequences, all program based on terminfo should work with it. By default, FbTerm sets environment variable "TERM" to value "linux", you need run "TERM=fbterm /path/to/program" to enable 256 color mode.

[2008-12-20] Release version 1.3

  1. added command line arguments to change option values
  2. added client-server based input method framework
  3. added screen rotation support
  4. added support for visual type DIRECTCOLOR used by ATI cards (thanks for Witek's patch)
  5. fixed a bug that user can't input some unicode characters
  6. fixed a bug of maybe not restore original console state after FbTerm exited
  7. fixed several trivial bugs
  8. added using file system capability attributes offered by kernel 2.6.27, instead of setting set-user-ID bit on FbTerm
  9. decreased memory usage of every shell instance by changing size of the struct saving every character's attribute from 4 to 2 bytes

In version 1.3, FbTerm first uses option value specified in command line arguments, then in the configure file $HOME/.fbtermrc. The format of configure file has been changed from "option_name=val" to "option-name=val", and several option names been modified to keep conformance with command line arguments. Old $HOME/.fbtermrc should be deleted when your begin to run this new version.

Instead of adding input method directly in FbTerm, a client-server based input method framework is designed to do this work. FbTerm acts as a client, standalone IM program as a server, they run in separated processes and communicate each other with predefined
IM messages in a unix socket pair. FbTerm provides a guide document and a IM demo to help developers understand the IM framework, and the fundamental sources of demo will make IM development more easier. Here is the screenshot of this demo on clockwise 270 degrees rotated screen.

http://fbterm.googlecode.com/svn/image/im.png'>http://fbterm.googlecode.com/svn/image/im_s.png' />

Everyones who want to write IM servers for FbTerm are very welcome. At present, two IM servers are under heavy development. If you are a normal IM user, please stay tuned!


[2008-10-12] Release version 1.2

  1. improved escape and control sequences compatibility with linux console, support sequences for changing the color palette and cursor shape
  2. added option to adjust default cursor shape and flash interval
  3. added option to modify chars considered as part of a word while auto-selecting text
  4. added handle signal SIGHUP, FbTerm will exit normally while shutdown system directly in it
  5. fixed a freeze issue caused by changing console win-size under kernel 2.6.26
  6. fixed a crash bug when font size is greater than screen size
  7. cleaned text selection code and fixed a crash bug
  8. fixed a error of not repainting screen when switch back to virtual console which FbTerm running on, but FbTerm not have active window
  9. fixed a buffer overflow issue which may cause denial of service via application crash

FbTerm now support linux control sequence for changing the color palette, let's see a example:

    if [ "$TERM" = "linux" ]; then

echo -en "\e]P0222222" #black
echo -en "\e]P8222222" #darkgray
echo -en "\e]P1803232" #darkred
echo -en "\e]P9982b2b" #red
echo -en "\e]P25b762f" #darkgreen
echo -en "\e]PA89b83f" #green
echo -en "\e]P3aa9943" #brown
echo -en "\e]PBefef60" #yellow
echo -en "\e]P4324c80" #darkblue
echo -en "\e]PC2b4f98" #blue
echo -en "\e]P5706c9a" #darkmagenta
echo -en "\e]PD826ab1" #magenta
echo -en "\e]P692b19e" #darkcyan
echo -en "\e]PEa1cdcd" #cyan
echo -en "\e]P7ffffff" #lightgray
echo -en "\e]PFdedede" #white
clear #for background artifacting
fi

As with all escape codes, it begins with a little prefix indicating what the escape is actually doing: in this case "\e]P", which is the "set color" escape. The format for the data is "XRRGGBB" where X is the number of the color to modify (in hex). This is a standard 16 color notation, which I have commented above. RRGGBB indicates the red/green/blue values (0-255). To reset the color palette, use "\e]R".


[2008-08-23] Release version 1.1

  1. add configurable additional text encoding support and switch between them with hot keys
  2. add option in configure file to let user adjust max scroll-back history lines of every window
  3. fixed cursor drawing issue while shell command line containing double width characters
  4. fixed a spelling error in source for older kernel support
  5. fixed a compile failure while kernel headers version less than 2.6.24

[2008-07-05] Release version 1.0

Project Information

  • License: GNU GPL v2
  • 85 stars
  • svn-based source control

Labels:
terminal framebuffer linux