A text-mode web browser

•  HOME  •  THEORY  •  PRACTICE  •    •  LOGIN  •  FORUM  •  CONTACT  • 

The World Wide Web took off after Marc Andreessen and Eric Bina at the NCSA released Mosaic for X-Windows on Unix in 1993. This was the first browser to support graphics, hence its immediate appeal to a wide audience of users and developers. In spite of the usability and appeal of graphics, text-mode browsers continue to be popular amongst competent users, and for a number of reasons. Firstly, they load and render rapidly, and do not require a mouse, a feature much appreciated by keyboard aficionados. They automatically eliminate the maze of banner ads and other distractions that clutter so many web pages these days. They can save a page as formatted ASCII text, which is better for archiving than a marked-up page. And, once a new keyboard paradigm is understood, they navigate links more quickly than GUI browsers.

The most popular text-mode browser today is Lynx, which is installed by default in many distros. W3m is also popular, but my personal preference is Elinks, available from elinks.or.cz What follows refers directly to Elinks, but can be applied to others. The key to familiarity with text-mode browsing is to understand its origins and history. In the era when the Internet was "text-only", many files were of two main types: one containing mostly content, the other mostly links. In the first case, the reader would scroll slowly down whilst reading the document, and in the second would scan the list of links looking for specific items. This gave rise to a different keyboard paradigm.

As shown in the diagram, Elinks (like Lynx) uses the arrow keys to navigate links, not for cursor movement. Initially this takes some getting used to, but once mastered quickly becomes intuitive. The same paradignm is used by other programs (e.g. Midnight Commander) and is referred to as "Lynx-like motion". It also explains the "Scroll Lock" key that is present on every keyboard, but today does nothing. In the early days of computers, activating Scroll Lock converted the arrow keys from cursor movement to page scrolling, a real convenience that is no longer available, yet previously regarded as so useful that it got its own key and LED indicator.

In order to use Elinks effectively, a few simple configuration changes are necessary. Default keybindings are built-in, but all can be changed using the Keybinding Manager. Those who prefer unshifted keys will want to change the most commonly used, as suggested in the Custom column of the table below. All settings are contained in ~/.elinks/ - that is, the "dot-elinks directory" in the User's Home Directory. Configuration files are "flat ASCII" and can be manually edited by those confident in doing so.

Elinks can be invoked with a URL on the commandline, but for regular browsing it's better to have a page of regularly-used links as the default Home Page. It's also useful to change to a dedicated directory where downloaded files can be stored. Of the several ways of doing this, here is my own. First create the required directory - I've called it "Elinks". Copy into it a simple HTML file such as that available below. Then put an alias in your ~/.bashrc - the Bash runtime configuration file (Use help alias if you're unsure what this is). My own entry looks like this:

alias el='cd /home/user/Elinks; elinks Index.html'

Invoking this executes two commands (separated by the semicolon). The first changes to the Elinks directory, the second invokes Elinks with the Index.html file, and I'm ready to surf. Default keybindings are shown in the table below; duplicates are in faint text, commonly-used bindings are dark. Any bindings in ~/.elinks/elinks.conf will override these.

An Elinks configuration file containing the bindings in the "Custom" column is available here. Don't forget to rename it from elinks.custom.conf to elinks.conf before using it.

A simple HTML links page is available here.

These provide some background for those interested:

  1. www.linuxjournal.com/article/8148 Roundup of text-mode browsers from Linux Journal in 2005.
  2. www.livinginternet.com/w/wi_browse.htm History of web browsers.

Default Bindings

Action  Default    Custom  
Quit without confirmationQq
Open a quit confirmation dialog boxq
Save the current document in source form.sS
Save the current document in formatted form.Ss
Abort connectionz 
Activate the menuEscape 
Activate the menuF9 
Open the File menuF10 
Open the Tab menue 
Open the Link context menuL 
Toggle wrapping of textW 
Toggle rendering page as HTML / plain text\ 
Open Keybinding managerk 
Open Bookmark managersb
Open Options managero 
Open History managerh 
Open Form History managerF 
Open Download managerD 
Open Cache managerC 
Open Cookie managerK 
Reload cookies fileCtl - K 
Show information about the current page= 
Show information about the current page protocol headers| 
Reload the current pageCtl - Rr
Redraw the terminalCtl - L 
Action  Default    Custom  
Open a new tabtT
Open the current link in a background tabTt
Close tabc 
Close all tabs but current a
Previous tab<,
Next tab>.
Move the current tab to the leftAlt - < 
Move the current tab to the rightAlt - > 
Action  Default    Custom  
Move to the previous frameAlt - Tab 
Move to the next frameTab 
Maximize the current framef 
Action  Default    Custom  
Kill background connections K
View the current imagev 
Toggle usage of document specific colors% 
Toggle displaying of links to images* 
Toggle displaying of links numbers. 
Open a Lua console, 
Enter ex-mode: 
Action  Default    Custom  
Go to the homepageH 
Move to the start of the documentHome 
Move to the start of the documentCtl - A 
Move to the end of the documentEnd 
Move to the end of the documentCtl - E 
Move upwards by a pagePageUp 
Move upwards by a pageCtl - B 
Move upwards by a pageb 
Move downwards by a pagePageDown 
Move downwards by a pageCtl - F 
Move downwards by a pageSpace 
Scroll upInsert 
Scroll upCtl - P 
Scroll downDelete 
Scroll downCtl - N 
Scroll left[ 
Scroll left{ 
Scroll right] 
Scroll right} 
Go forward in historyu 
Open "Go to URL" dialog boxg 
Open "Go to URL" dialog box containing the current URLG 
Open "Go to URL" dialog box containing the current link URLE 
Action  Default    Custom  
Move to the previous linkUp 
Move to the next linkDown 
Open the current link in a new tab in the backgroundT 
Return to the previous document in historyLeft 
Follow the current linkRight 
Follow the current linkEnter 
Follow the current link, forcing reload of the targetCtl-Right 
Follow the current link, forcing reload of the targetCtl-Enter 
Follow the current link, forcing reload of the targetx 
Add a new bookmark using current linkACtl - D
Jump to linkl 
Download the current linkd 
Attempt to resume download of the current linkr 
Action  Default    Custom  
Add a new bookmarka 
Add a new bookmark using current linkACtl - D
Set a markm 
Go at a specified mark' 
Copy text to clipboardCtl-Insert 
Search backwards for a text pattern? 
Search forwards for a text pattern/ 
Find the previous occurrence of the current search textN 
Find the next occurrence of the current search textn 
Search link text by typing ahead#