5

After opening a feed in newsboat, we have the option to open in browser using the o key.

However, when I press the o key, I get Browser returned error code 127.

Looking online, I'm told to add browser firefox to the config file of newsboat. Somewhere else I'm told to add browser "w3m %u". I've tried both and neither worked and I still get the error above.

What can I do to make o work in newsboat?

My operating system is Ubuntu 20.04.

$ which newsboat
/snap/bin/newsboat

$ echo $BROWSER returns nothing

$ newsboat -v
newsboat r2.20.1-3-gb8c2a-dirty - https://newsboat.org/
Copyright (C) 2006-2015 Andreas Krennmair
Copyright (C) 2015-2020 Alexander Batischev
Copyright (C) 2006-2017 Newsbeuter contributors
Copyright (C) 2017-2020 Newsboat contributors 
Newsboat is free software licensed under the MIT License. 
(Type `/snap/newsboat/2764/usr/local/bin/newsboat -vv' to see the full text.)
It bundles:
  - JSON for Modern C++ library, licensed under the MIT License: https://github.com/nlohmann/json
  - optional-lite library, licensed under the Boost Software License: https://github.com/martinmoene/optional-lite
  - expected-lite library, licensed under the Boost Software License: https://github.com/martinmoene/expected-lite 
newsboat r2.20.1-3-gb8c2a-dirty
System: Linux 5.4.0-40-generic (x86_64)
Compiler: g++ 7.5.0
ncurses: ncurses 6.1.20180127 (compiled with 6.1)
libcurl: libcurl/7.58.0 OpenSSL/1.1.1 zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3 (compiled with 7.58.0)
SQLite: 3.22.0 (compiled with 3.22.0) libxml2: compiled with 2.9.4

$ cat ~/.newsboat/config
cat: /home/user/.newsboat/config: No such file or directory

The last output is because I make my changes in the directory ~/snap/newsboat/2764/.newsboat/config, which works for me when I put in other config lines like auto refresh and refresh timer. So maybe that's not an issue?

Zanna
  • 72,471
stavro
  • 69
  • 1
    Please add output of which newsboat, echo $BROWSER, newsboat -v, cat ~/.newsboat/config to the question by editing it. – N0rbert Jul 05 '20 at 08:41
  • @N0rbert I have added the outputs of those commands to my above question. – stavro Jul 06 '20 at 01:59
  • For more reproducible results I would suggest to remove snapped version and install deb-package instead with snap remove newsboat , sudo apt-get install newsboat . Then copy config and urls files to ~/.newsboat . – N0rbert Jul 06 '20 at 05:40

4 Answers4

3

You have to add one configuration option to ~/.newsboat/config config file:

browser "firefox %u"

See man newsboat for details locally or online.

N0rbert
  • 103,523
  • 1
    I added that to the top line of my config file and still it does not work. The other commands I have in the config file, like refresh everry 1 minute, does work. So Im pretty sure im editing the correct file and it's being read. – stavro Jul 05 '20 at 06:43
1

There's likely a more elegant answer out there, but because I didn't want to spend too much time in the weeds on this, one option that worked for me was adding:

"browser "open -a safari '%u'"

..in the config file. All credit to this Reddit (https://www.reddit.com/r/newsboat/comments/ijm8yw/im_lost_with_browsers/) that provided ideas, and some explanations.

On Linux (PopOS installation), added the following:

"browser "xdg-open '%u'"
1

Not really adding much, but adding this to the ~/.newboat/config worked for me:

browser "$BROWSER %u"

Obviously I have my browser (currently firefox) set as the BROWSER env variable in ~/.profile.

Zanna
  • 72,471
1

With Snap, you have to use xdg-open (see here). Add this line to config:

browser xdg-open

  • If there is info on that link it needs to be in this question. That link may not be around later. – David DE Aug 26 '25 at 09:22
  • @DavidDE That's not really the case. The answer explains the solution itself, and links are just fine when they add additional information not necessary for the solution. – NotTheDr01ds Sep 03 '25 at 23:50