Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
0
votes
2
answers
672
views
w3m website dump without line break
I am not a native english speaker, if any grammatical mistakes please forgive me every one says books are best friend and remove ignorance, so I got a online library but my english is not good, so i decided that download the text of book and translate it ino my native language with google translate...
I am not a native english speaker, if any grammatical mistakes please forgive me
every one says books are best friend and remove ignorance, so I got a online library but my english is not good, so i decided that download the text of book and translate it ino my native language with google translate cli.
https://kpu.pressbooks.pub/political-ideologies/front-matter/introduction/
so i install w3m cli web browser and visit the above said website with w3m cli web browser, Here the output is without line breaks.
w3m
but when I store the output of this website it into file the ,there is line breakage
the commands are
1) w3m >file.txt
or
2) w3m -dump > file.txt
after investigating, i found that the coloumn size of each row is around 80.
the terminal column size 80.
So in short the line breakage text converted into 1 continuous paragrach.
so suggest me a solution
thanks in advance
mohammed taqi ahmed
(1 rep)
May 7, 2023, 09:23 AM
• Last activity: Apr 25, 2024, 03:16 PM
0
votes
0
answers
67
views
in w3m the lines on some webpages don't fit (practically any) terminal window
For instance on [this page](https://www.makemkv.com/developers/usage.txt) ([archive][1]) the text extends to infinity, w3m doesn't wrap the lines at all for unknown reasons. lynx in comparison isn't affected. I can only read by scrolling the affected lines using the w3m cursor. Depending on the size...
For instance on [this page](https://www.makemkv.com/developers/usage.txt) (archive ) the text extends to infinity, w3m doesn't wrap the lines at all for unknown reasons. lynx in comparison isn't affected.
I can only read by scrolling the affected lines using the w3m cursor. Depending on the size of my terminal window the lines are cut off in this manner:
> --progress=file
Output all progress messages to file. The same special file names as in --messages are recognized with
when I'd expect the lines to be wrapped — the full paragraph:
> --progress=file
Output all progress messages to file. The same special file names as in --messages are recognized with additional value "-same" to output to the same file as messages. Naturally --progress should follow --messages in this case. Default
is no output.
Is this by design or a clear bug?
---
w3m version w3m/0.5.3+git20230121, options lang=en,m17n,image,color,ansi-color,mouse,gpm,menu,cookie,ssl,ssl-verify,external-uri-loader,w3mmailer,nntp,gopher,ipv6,alarm,mark
This superuser.com question isn't a duplicate, the OP is attempting to configure a fixed line length.
user598527
(735 rep)
Nov 25, 2023, 05:16 PM
• Last activity: Nov 25, 2023, 06:00 PM
4
votes
1
answers
259
views
terminal: Error occurred while reset 800b: errno=25
I have an extremely bizarre problem, occurring somewhere at the intersection of `terminal`, `su`, `w3m` and `/dev/null`: when I `su -` from `user1` to `user2`, following command does not work: $ w3m zz.html 2>/dev/null Error occurred while reset 800b: errno=25 but the same command works fine without...
I have an extremely bizarre problem, occurring somewhere at the intersection of
terminal
, su
, w3m
and /dev/null
:
when I su -
from user1
to user2
, following command does not work:
$ w3m zz.html 2>/dev/null
Error occurred while reset 800b: errno=25
but the same command works fine without the 2>/dev/null
redirection:
$ w3m zz.html
And finally, when I login directly as user2
(instead of switching from user1
), everything works fine (both with 2>/dev/null
and without)
When I run w3m
with strace
: strace -o zz.strace w3m zz.html 2>/dev/null
, I see the two cases (working and non-working) starting to diverge at this point:
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, TIOCGWINSZ, {ws_row=77, ws_col=199, ws_xpixel=0, ws_ypixel=0}) = 0
ioctl(2, TIOCGWINSZ, 0x7318fb8e7c40) = -1 ENOTTY (Inappropriate ioctl for device)
fstat(2, {st_mode=S_IFCHR|0666, st_rdev=makedev(0x1, 0x3), ...}) = 0
ioctl(2, TCGETS, 0x7318fb8e7400) = -1 ENOTTY (Inappropriate ioctl for device)
brk(0x16a51a8a1000) = 0x16a51a8a1000
brk(0x16a51a8b1000) = 0x16a51a8b1000
brk(0x16a51a8c2000) = 0x16a51a8c2000
brk(0x16a51a8d2000) = 0x16a51a8d2000
brk(0x16a51a8e8000) = 0x16a51a8e8000
ioctl(2, TCGETS, 0x7318fb8e7bd0) = -1 ENOTTY (Inappropriate ioctl for device)
ioctl(2, TCGETS, 0x7318fb8e7bc0) = -1 ENOTTY (Inappropriate ioctl for device)
ioctl(2, SNDCTL_TMR_START or TCSETS, {B0 -opost -isig -icanon -echo ...}) = -1 ENOTTY (Inappropriate ioctl for device)
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0x7), ...}) = 0
write(1, "Error occurred while reset 800b:"..., 42) = 42
write(2, "\33[?1049h\33[22;0;0t\33[H\33[2J\33[39;49m"..., 58) = 58
ioctl(2, TCGETS, 0x7318fb8e7ba0) = -1 ENOTTY (Inappropriate ioctl for device)
ioctl(2, SNDCTL_TMR_START or TCSETS, {B0 -opost -isig -icanon -echo ...}) = -1 ENOTTY (Inappropriate ioctl for device)
exit_group(1) = ?
+++ exited with 1 +++
From what I was able to find, the TIOCGWINSZ
ioctl
seems to be something related to terminal size. But I am not able to find what exactly is causing this problem.
Martin Vegter
(598 rep)
Oct 20, 2022, 04:59 AM
• Last activity: Oct 27, 2022, 12:08 PM
16
votes
4
answers
11068
views
Yanking URLs in w3m
I have been using w3m for a couple of weeks and am convinced that it is my preferred text browser - with one exception. Is there any way to yank URLs to the clipboard without using the mouse ? I have looked through the manual and, using the default keybindings, there doesn't appear to be any documen...
I have been using w3m for a couple of weeks and am convinced that it is my preferred text browser - with one exception.
Is there any way to yank URLs to the clipboard without using the mouse?
I have looked through the manual and, using the default keybindings, there doesn't appear to be any documented way to do this.
Has anyone developed a script to work around this?
jasonwryan
(74647 rep)
May 3, 2011, 02:01 AM
• Last activity: Aug 26, 2022, 03:09 PM
2
votes
2
answers
556
views
Is it possible to bind '2M' to a single key in w3m?
Pressing M in `w3m` launches the 1st external browser, 2 M the second. While it is easy to bind the built-in command `EXTERN` to another key, is it possible to bind the second to another key?
Pressing M in
w3m
launches the 1st external browser, 2M the second. While it is easy to bind the built-in command EXTERN
to another key, is it possible to bind the second to another key?
Jing
(339 rep)
Dec 14, 2012, 03:15 AM
• Last activity: Aug 25, 2022, 07:22 AM
5
votes
3
answers
2373
views
Can w3m automatically search the entered text?
Is there a way to configure w3m so that with 'U', i.e. after entering text into the URL field, the browser will automatically prepend "google.com/search?q=" to it? Or can some other command be used or defined to obtain the same effect? I tried calling a shell script via "#" but it just passes output...
Is there a way to configure w3m so that with 'U', i.e. after entering text into the URL field, the browser will automatically prepend "google.com/search?q=" to it?
Or can some other command be used or defined to obtain the same effect? I tried calling a shell script via "#" but it just passes output into buffer.
Adam Kaminsky
(51 rep)
Feb 5, 2015, 06:17 AM
• Last activity: Aug 25, 2022, 07:07 AM
2
votes
1
answers
634
views
How to get around 403 errors on websites with text-based browsers?
The issue seems to stem from a misconfigured web server and has affected some domains I've came across in `lynx` and `w3m`, but `links` can access at least in some instances. Can this be resolved on the user-side? 403 Forbidden ------------------------------------------------------------------------...
The issue seems to stem from a misconfigured web server and has affected some domains I've came across in
lynx
and w3m
, but links
can access at least in some instances. Can this be resolved on the user-side?
403 Forbidden
-------------------------------------------------------------------------------------
nginx
user598527
(735 rep)
May 19, 2022, 08:26 AM
• Last activity: May 19, 2022, 12:30 PM
0
votes
2
answers
413
views
Raspbian running headless doing scripted procedures on a internet page using text browser
I am somewhere between a new and intermediate linux user. I am setting up a local network for a small group, and I need to configure an automatic sign-in to a webportal when internet connectivity is lost. I have this working when I run my bash script with a monitor on the raspberry (RASPBIAN OS) its...
I am somewhere between a new and intermediate linux user.
I am setting up a local network for a small group, and I need to configure an automatic sign-in to a webportal when internet connectivity is lost.
I have this working when I run my bash script with a monitor on the raspberry (RASPBIAN OS) itself, the sequence of things are:
Check if internet is down with fping --> Open xterm --> have xdotool open w3m and automate the clicks and inputting password.
Here is my code in condensed form:
DNSPing=$(fping 9.9.9.9)
EtecsaPing=$(fping 10.180.0.30)
...
if [[ ( $EtecsaPing == "10.180.0.30 is alive" ) && ( $DNSPing == "9.9.9.9 is unreachable" ) ]]
then
echo "ETECSA UP - Internet all down - Run login script now"
xterm &
sleep 2
xdotool type "w3m -m https://10.180.0.30:8443/ "
xdotool key Return
...
xdotool type
xdotool key Return
xdotool sleep 1
...
xdotool key Return
xdotool type
xdotool sleep 1
...
xdotool key Return
sleep 5
killall xterm
fi
So when I connect a monitor and mouse and run this it works just fine.
I want to have this running headless and with the script in crontab, and after 2 days of trying I feel like I'm just going in circles.
The problem is that both the new xterm session and xdotool requires a DISPLAY defined to run.
To that end I have installed xvfb which creates a simulated display.
sudo Xvfb :10 -ac -screen 0 1024x768x24
DISPLAY=:10 xterm & (the script from above)
That runs without any errors, but it also does not work.
If I run:
sudo Xvfb :10 -ac -screen 0 1024x768x24
DISPLAY=:10 xterm -e "echo 'deb blah ... blah' | sudo tee -a /CronJobs/yap.txt > /dev/null"
It adds the echo to the file, so I know that my display is running the xterm session, and I conclude the simulated display and xterm session is all working.
If I do:
sudo Xvfb :10 -ac -screen 0 1024x768x24
DISPLAY=:10 xterm &
DISPLAY=:10 xdotool type "sudo echo 'deb blah ... blah' | sudo tee -a /CronJobs/yap.txt > /dev/null"
DISPLAY=:10 xdotool key Return
It does not work.
In conclusion, xdotool is working (no errors), but not doing anything!
So I'm thinking xdotool is not typing into the xterm terminal because the window is not selected, and I try to select the xterm window and I get:
DISPLAY=:10 xdotool getactivewindow
Your windowmanager claims not to support _NET_ACTIVE_WINDOW, so the attempt to query the active window aborted.
xdo_get_active_window reported an error
And at this point my project is so unique that I can't find any good suggestions on what to do. A few people have tried to exchange the windowmanager for Xvfd but it's few and complicated.
Put in simple words:
- How can I make Xvfd act better like a real display?
- Can I make the linux forget all about DISPLAY variables and windowmanager, and just unconditionally run the script as a normal user? How?
- Can I automate my login sequence in a smarter way that would avoid xdotool?
My network is private and I have no issue with solutions that can compromise the security on the raspberry, so disabling whatever xhost etc is fine, I just don't see how/what.
Thanks in advance.
Lars Kuur
(11 rep)
Nov 4, 2021, 10:44 PM
• Last activity: Nov 6, 2021, 04:15 PM
21
votes
1
answers
5759
views
How to pipe html into w3m?
In [this post][1] is shown how to pipe `curl` output to `lynx`. How can get the same with `w3m`? I mean something like: curl https://www.google.it | w3m I do not want to use a temporary file. [1]: https://unix.stackexchange.com/q/271945
In this post is shown how to pipe
curl
output to lynx
. How can get the same with w3m
?
I mean something like:
curl https://www.google.it | w3m
I do not want to use a temporary file.
Gabriele
(353 rep)
Jun 26, 2017, 06:33 PM
• Last activity: Oct 26, 2021, 08:41 AM
3
votes
1
answers
698
views
Downloading file using command line tool in Linux VM which requires sign-in
**Environment**: Linux VM which I have access only through command line console. **Goal**: I need to download the file: https://download.nlm.nih.gov/umls/kss/2020AA/umls-2020AA-full.zip Unlike typical download using `wget`, this redirects to a sign-in page. **What I have tried till now**: Tried usin...
**Environment**: Linux VM which I have access only through command line console.
**Goal**:
I need to download the file: https://download.nlm.nih.gov/umls/kss/2020AA/umls-2020AA-full.zip
Unlike typical download using
But when browsing using text based browsers in the VM, it only shows a blank page.
Is there any solution to this issue?
N.B.
- The link to above zip file is mentioned in https://www.nlm.nih.gov/research/umls/licensedcontent/umlsarchives04.html#2020AA
- As it is a huge file, I don't have the option to download in my local system and then upload it to the VM.
- Had originally asked the question in StackOverflow, but was suggested to raise the question in this forum (so I deleted the original post).
wget
, this redirects to a sign-in page.
**What I have tried till now**:
Tried using the text based browsers: w3m , elinks . Until recent changes in the sign-in page, it used to work.
**What had changed in the sign-in page?**
Earlier the sign-in page used to take username and password. But recently they have introduced option to sign-in via Google, Microsoft etc.
**Problem**
The sign-in page looks like this in my local m/c:

Kaushik Acharya
(133 rep)
Nov 17, 2020, 07:10 AM
• Last activity: Feb 8, 2021, 06:21 PM
3
votes
1
answers
7576
views
Alacritty Ranger w3m: Images are not showing or disappear after few seconds
I am using Alacritty and ranger. I have also installed `w3m`. This is part of my `~/.config/ranger/rc.conf`: ``` set preview_images true set preview_images_method w3m set w3m_offset 0 ``` Most of the time images do not show at all. Just black space. And if they show up they disappear after 2 or 3 se...
I am using Alacritty and ranger. I have also installed
The versions I use:
- ranger 1.9.3
- Python 3.9.1
- w3m/0.5.3+git20200507
What should I do to be able to preview images in ranger ?
Thank you for help
w3m
.
This is part of my ~/.config/ranger/rc.conf
:
set preview_images true
set preview_images_method w3m
set w3m_offset 0
Most of the time images do not show at all. Just black space. And if they show up they disappear after 2 or 3 seconds.
When I set set preview_images_method terminology
, it looks like this:

Jan Černý
(1723 rep)
Feb 3, 2021, 11:37 PM
• Last activity: Feb 4, 2021, 08:12 AM
32
votes
3
answers
15632
views
Is there a back-"button" in w3m?
Does w3m offer a keyboard shortcut to go back one page? I couldn't find anything in the man pages.
Does w3m offer a keyboard shortcut to go back one page? I couldn't find anything in the man pages.
OliverS
(433 rep)
Oct 12, 2010, 08:09 AM
• Last activity: Jan 27, 2021, 05:39 PM
1
votes
1
answers
580
views
How to turn off images in w3m
I would like to know how to turn OFF images in w3m. I installed w3m images so that i could view images in the cli program ranger. But I would prefer to turn this off for w3m. I would have thought that there would be some option in .w3m/config but I am finding it very difficult to find good documenta...
I would like to know how to turn OFF images in w3m. I installed w3m images so that i could view images in the cli program ranger. But I would prefer to turn this off for w3m.
I would have thought that there would be some option in .w3m/config but I am finding it very difficult to find good documentation on this.
Is there anyone that can help me?
Thanks
Gerry H
(11 rep)
Feb 2, 2020, 05:22 PM
• Last activity: Sep 7, 2020, 08:15 PM
1
votes
1
answers
479
views
Does w3m support input type="file" form fields?
I am trying to figure out a simple way to submit a file stored on a distant Ubuntu server to an HTML form on the web. The form uses ` ` field. This seems to be [not supported by Lynx](https://lynx.invisible-island.net/lynx2.8.3/breakout/lynx_help/Lynx_users_guide.html#Forms): > Lynx does not yet sup...
I am trying to figure out a simple way to submit a file stored on a distant Ubuntu server to an HTML form on the web. The form uses `` field. This seems to be [not supported by Lynx](https://lynx.invisible-island.net/lynx2.8.3/breakout/lynx_help/Lynx_users_guide.html#Forms) :
> Lynx does not yet support INPUTs with TYPE="file"
But can it be handled by w3m? Or any other text-based browser?
Andriy Makukha
(548 rep)
Nov 22, 2018, 05:23 PM
• Last activity: Nov 22, 2018, 05:37 PM
4
votes
1
answers
5675
views
Mutt : render html within mutt
I want to render html within mutt but I haven't succeed configuring it yet. I want to use w3m so my _.mailcap_ looks like : text/html; "$BROWSER" %s &; test=test -n "$DISPLAY"; needsterminal; text/html; w3m -I %{charset} -T text/hmtl; copiousoutput; And for the rendering in mutt I have added : auto_...
I want to render html within mutt but I haven't succeed configuring it yet.
I want to use w3m so my _.mailcap_ looks like :
text/html; "$BROWSER" %s &; test=test -n "$DISPLAY"; needsterminal;
text/html; w3m -I %{charset} -T text/hmtl; copiousoutput;
And for the rendering in mutt I have added :
auto_view text/html
alternative_order text/plain text/enriched text/html
This is what I looks like when I open a _text/html_ document (I press
--
Adina Giorgianna Ralea
Gestionnaire du cours L3 +Mathématiques-Informatique 2015-2016 (L3MI2014)
Diderot en ligne
Administrateur: Admin
We can see that autoview is using w3m, but why isn't it rendering ?
v
and then return
to the _text/html_)
[-- Autoview using w3m -I 'utf-8' -T text/hmtl --]
Bonjour a tous,
Une page Didel pour le cours Analyse et Probabilites a ete cree.
Tous les etudiants qui suivent ce cours sont invites a y s'insrcire.
Les DMs vont etre mises en ligne sur ce site.
Cordialement,
Adina Ralea
--
Adina Giorgianna Ralea
Gestionnaire du cours L3 +Mathématiques-Informatique 2015-2016 (L3MI2014)
Diderot en ligne
Administrateur: Admin
We can see that autoview is using w3m, but why isn't it rendering ?
Nicolas Scotto Di Perto
(716 rep)
Jan 31, 2016, 06:27 PM
• Last activity: Sep 28, 2017, 07:09 PM
1
votes
1
answers
1385
views
curl wget - How to ignore the HTML Tag and headers
How to get only the content for web page what I see in browser... I don't want the headers and any HTML tag.. exp- http://www.linfo.org/cat.html.. I want only the content.. Please help
How to get only the content for web page what I see in browser... I don't want the headers and any HTML tag.. exp- http://www.linfo.org/cat.html .. I want only the content.. Please help
Arun
(31 rep)
Aug 21, 2017, 12:57 AM
• Last activity: Aug 21, 2017, 01:02 AM
6
votes
2
answers
5686
views
How I can configure w3m to use squid proxy (or any proxy) by default when invoked by a specific user?
Can I configure `w3m` to use `Squid` by default when invoked by a specific user in a bash login shell? I've looked inside the `w3m` configuration file, but I don't see any setting were I can set `squid` as the default proxy.
Can I configure
w3m
to use Squid
by default when invoked by a specific user in a bash login shell?
I've looked inside the w3m
configuration file, but I don't see any setting were I can set squid
as the default proxy.
VaTo
(3248 rep)
Aug 8, 2017, 06:35 PM
• Last activity: Aug 9, 2017, 04:21 AM
4
votes
0
answers
3266
views
How to display inline images in a terminal that update on scroll with w3mimgdisplay
The `w3mimgdisplay` program displays images in buffered terminal emulators. This is how: http://blog.z3bra.org/2014/01/images-in-terminal.html . But it is not very well documented. As pointed out in the post, this [thread][1] is probably the best you can get. Now, the problem is that the image does...
The
w3mimgdisplay
program displays images in buffered terminal emulators. This is how: http://blog.z3bra.org/2014/01/images-in-terminal.html . But it is not very well documented. As pointed out in the post, this thread is probably the best you can get.
Now, the problem is that the image does not stays when the terminal scrolls up. This post argues that "w3m
uses it as a persistent process to handle scrolling", but prefixing the command in line 7 with nohup
or subfixing with &
does not make any change. (And it's hard for me to trace back the use of w3mimgdisplay
in w3m
.)
So the question resumes as how to execute this command line as a persistent process:
echo -e "2;3;\n0;1;0;100;0;0;0;0;0;0;./image.png\n4;\n3;" | /usr/lib/w3m/w3mimgdisplay
Update:
Tested on gnome-terminal
on Lubuntu 16.04.
This is the X-face patch by Tamo referred in the post above.
nightcod3r
(972 rep)
Jun 2, 2017, 06:05 PM
• Last activity: Jun 3, 2017, 08:53 AM
2
votes
1
answers
3458
views
Grab http requests by lynx
I need to grab and debug all HTTP-requests and responds which I make from lynx or another text-based browser. How can I save all request URLs, redirects, headers and page sources for analyze and debug this information? I do not need JavaScript support. What tools are better for this purpose? **Updat...
I need to grab and debug all HTTP-requests and responds which I make from lynx or another text-based browser. How can I save all request URLs, redirects, headers and page sources for analyze and debug this information? I do not need JavaScript support. What tools are better for this purpose?
**Update**
To partially solve my problem, I used w3m text-based browser.
I start w3m with
-reqlog
option and w3m save all headers, addresses history and cookies in ~/.w3m
directory.
For example:
$ w3m -reqlog https://google.com
Check ~/.w3m
:
$ ls ~/.w3m
cookie history request.log
In ~/.w3m/request.log
stored all headers.
How can I keep the body of the pages?
Volodymyr Chumak
(141 rep)
Nov 19, 2014, 02:16 PM
• Last activity: Jan 1, 2017, 04:06 PM
8
votes
1
answers
5022
views
w3m specify http port
When using `w3m` terminal browser, how can I specify the http/s port that I want to use when connecting to a web server. There does not seem to be a `-p` option to use non-standard ports (80 & 443). The colon syntax, `localhost:8080` does not work either. Anyone know how to do this? Seems like I hav...
When using
w3m
terminal browser, how can I specify the http/s port that I want to use when connecting to a web server.
There does not seem to be a -p
option to use non-standard ports (80 & 443). The colon syntax, localhost:8080
does not work either.
Anyone know how to do this? Seems like I have been able to specify the port in addition to the host on w3m
before.
111---
(4663 rep)
Sep 26, 2016, 03:42 PM
• Last activity: Sep 26, 2016, 03:48 PM
Showing page 1 of 20 total questions