RSS

How-To Geek

W3M is a terminal web browser for Linux. It’s got a few tricks up its sleeve, including support for images, tabs, tables, frames and other features not usually included with terminal web browsers.

If you’ve used Linux for a while, you probably remember using a terminal browser to Google up a solution for your hardware when the X server refused to load. Modern X servers have advanced far beyond this, but W3M and other terminal browsers can still be useful.

Installing W3M

W3M isn’t included by default on most Linux distributions. You’ll want to install the main w3m package and the w3m-img package if you want inline image support. Use the following command on Ubuntu:

sudo apt-get install w3m w3m-img

Basic Browsing

W3M has quite a few command-line options, but none are mandatory. The only thing you need to specify is a web page address. Want to bring up Google? Just use the w3m google.com command.

You can use the arrow keys to move the cursor around or click at a desired location to move the cursor there. If you want to type in a text box, select the text box with your cursor and press Enter before typing your text. W3M treats your keystrokes as commands if you just start typing.

Load a hyperlink by selecting it with your cursor and pressing Enter. You don’t have to select hyperlinks manually — press the Tab key to position your cursor over the next hyperlink on the page.

Shift-B will take you back a page. If you want to load a different URL, press Shift-U and you’ll get an URL prompt. Press Shift-H to view the help page if you want to see a more complete list of keyboard shortcuts.

Images in the Terminal

W3M supports images, so where are they? Well, terminals like GNOME Terminal and KDE’s Konsole can’t display W3M’s images. Other terminals, such as Xterm, can. W3M will also display images if you’re running it in a framebuffer console, so you don’t need an X server running to take advantage of this feature.

Another feature that doesn’t work in GNOME Terminal or Konsole is W3M’s right-click menu.

Browser Tabs

How did we ever live without tabs? They’re an essential feature for desktop web browsers. W3M includes tabs, too. Just press Shift-T to open a new tab.

You can switch between tabs by clicking them, but we’re trying to be terminal ninjas here. Use the { and } keys to switch between tabs without touching your mouse (that’s Shift-[ and Shift-]).

Gmail in the Terminal

W3M isn’t stuck in the past, like Lynx (another web browser for the terminal) is. It can render tables, frames and even has support for Gmail’s basic HTML interface.

You’d probably feel more comfortable accessing Gmail with an IMAP client from your terminal, but hey — it works.

More Documentation

In addition to pressing Shift-H to view W3M’s help page, you can view the full manual on W3M’s website. The manual lists all of W3M’s command-line switches and key bindings.

W3M still doesn’t compare with desktop browsers — notably, it doesn’t support JavaScript. There’s an experimental w3m-js extension you can compile and install yourself, but I wouldn’t rely too much on that. Then again, do you really want JavaScript in a terminal browser?

Yes, I remember starting out with Linux 8 years ago (Wow!). The X-server would crash and I’d have to configure the x.org file via the virtual terminal. I could have saved lots of wasted time if I’d known that from the start!
twitter @tsairox I love Linux!

I’ve been playing with it and trying to find out for you. It looks like you can’t, though — at least not if you use Shift-B to go back

If you press “s”, you’ll see a list of buffers you can select (basically the previous pages you can go back to. Select one of these buffers and you’ll go back to a previous page. From there, you can press “s” again and select one of the buffers to “go forward.”

If you use Shift-B, it appears to erase the page from the buffer, preventing you from going forward to it.

Hope that helped — “s” looks like the trick to use if you want to go forward.

GEEK TRIVIA

DID YOU KNOW?

In the 1980s, many families owned a VHS deck but no VHS tapes; throughout the decade half of the VHS deck owners in America had yet to purchase a movie and instead relied on weekly rentals from a neighborhood store.