Results 1 to 4 of 4

Thread: Browse web via terminal with w3m and xterm

  1. #1

    Default Browse web via terminal with w3m and xterm

    Hi,
    I wish
    to browse internet via terminal. I want to use w3m with xterm. However, when I try to start xterm with white background and black font color
    xterm -bg white -fg black
    I get
    message: xterm: Xt error: Can't open display:
    xterm: DISPLAY not set
    .
    I have tried several ways, using solutions from the internet, to correct the problem but none of them work. I wonder if anyone can help. Will be very grateful.



  2. #2
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    13,841
    Blog Entries
    3

    Default Re: Browse web via terminal with w3m and xterm

    "xterm" is an X-windows application. It runs on top of an X graphic session. And $DISPLAY should be already defined within that session.

    If you are trying to run "xterm" on a virtual console (CTRL-ALT-Fn), then that is not going to work. But you can probably run "w3m" or "lynx" or "links" or other command line browser directly in that virtual console session (without starting an "xterm").
    openSUSE Leap 15.2; KDE Plasma 5.18.5;

  3. #3
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    12,300
    Blog Entries
    2

    Default Re: Browse web via terminal with w3m and xterm

    First,
    I'd recommend you follow @nrickert's advice to run one of the text-based web browsers he lists, I don't think you can surf the Internet in a bare terminal console... You need to run an app with some functionality to surf the Internet which doesn't exist in XTerm. Depending on how the app is written, <maybe> it might run in XTerm, maybe not (YMMV depending on the app you use and its configuration).

    As for changing colors in XTerm,
    Instead of trying to pass flags on the command line, I'd recommend instead modifying the XTerm configuration file(s).
    To identify these configuration files(because the openSUSE files and locations are different than what is described in the XTerm MAN pages), I'd recommend installing the locate utility (package mlocate), updating the database immediately and then simply searching for "XTerm"
    The result will be 6 files, 3 which obviously are color configurations, I recommend you open and modify "XTerm-color"
    In fact you'll find a setting you only need to uncomment to reverse your foreground and background colors.

    HTH,
    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  4. #4
    Join Date
    Jun 2008
    Location
    West Yorkshire, UK
    Posts
    3,519

    Default Re: Browse web via terminal with w3m and xterm

    Both w3m and lynx work fine in xterm; so the original issue is an xterm configuration issue.

    It is perfectly practical to surf the web using command line browsers as long as the sites do not depend on scripting languages which are not supported by the browser. The main problem is that most websites are not designed for command line use; so typically they have a long list of menu items at the top of every page which you have to scroll through to get to the content of the page.

    One use of command line browsers today is to support screen readers; so looking at a website using a command line browser is a good way of finding out the sort of experience which a visually impaired user might have.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •