1
2URLSCAN(1) General Commands Manual URLSCAN(1)
3
4
5
7 urlscan - browse the URLs in an email message from a terminal
8
10 urlscan [options] < message
11
12 urlscan [options] message
13
14
16 urlscan accepts a single email message on standard input, then displays
17 a terminal-based list of the URLs in the given message. Selecting a
18 URL uses the Python webbrowser module to determine which browser to
19 open. The BROWSER environment variable will be used if it is set.
20
21 urlscan is primarily intended to be used with the mutt (1) mailreader,
22 but it should work well with any terminal-based mail program.
23
24 urlscan is similar to urlview(1), but has the following additional fea‐
25 tures:
26
27 1. Support for more message encodings, such as quoted-printable and
28 base64.
29
30 2. Extraction and display of the context surrounding each URL. Toggle
31 context view on/off with c.
32
33 3. Copy current URL to primary selection with P or to clipboard with C.
34
35 4. URLs are shortened by default to fit on one line. Toggle one or all
36 shortened URLs with s or S.
37
38 5. Incremental case-insensitive search using /. Footer shows current
39 search term. / again resets search.
40
41 6. Cycle through all available palettes (color and black & white avail‐
42 able by default) using p. Running urlscan -g will generate a ~/.con‐
43 fig/urlscan/config.json file for editing or adding additional pallettes
44 and keybindings. See
45
46 http://urwid.org/manual/displayattributes.html#display-attributes
47
48 for color options and allowed values.
49
50 7. u will unescape the highlighted URL if necessary.
51
52 8. Run a command with the selected URL as the argument or pipe the
53 selected URL to a command using the --run and --pipe arguments.
54
55 9. Use l to cycle through whether URLs are opened using the Python web‐
56 browser module (default), xdg-open (if installed) or a function passed
57 on the command line with --run. The --run function will respect the
58 value of --pipe.
59
60 10. F1 shows the help menu.
61
62
64 -g, --genconf
65 Generate ~/.config/urlscan/config.json with default options.
66
67 -c, --compact
68 Display a simple list of the extracted URLs, instead of showing
69 the context of each URL. Also toggle with `c` from within the
70 viewer.
71
72 -H, --nohelp
73 Start with header menu hidden.
74
75 -d, --dedupe
76 Remove duplicated URLs from the list of URLs.
77
78 -n, --no-browser
79 Disables the selection interface and print the links to standard
80 output. Useful for scripting (implies --compact).
81
82 -r, --run <expression>
83 Execute <expression> in place of opening URL with a browser. Use
84 {} in <expression> to substitute in the URL. Examples:
85
86 $ urlscan --run 'echo {} | xclip -i' file.txt
87 $ urlscan --run 'tmux set buffer {}'
88
89 -p, --pipe
90 Pipe the selected URL to the command specified by `--run`. This
91 is preferred when the command supports it, as it is more secure
92 and tolerant of special characters in the URL. Example:
93
94 $ urlscan --run 'xclip -i' --pipe file.txt
95
96
98 To integrate urlscan with mutt, include the following two commands in
99 ~/.muttrc:
100
101
102 macro index,pager \cb "<pipe-message> urlscan<Enter>" "call urlscan to
103 extract URLs out of a message"
104
105 macro attach,compose \cb "<pipe-entry> urlscan<Enter>" "call urlscan to
106 extract URLs out of a message"
107
108
109 Once these lines are in your mutt configuration file, pressing Control-
110 b will allow you to browse and open the URLs in the currently selected
111 message.
112
113 Alternately, you can pipe a message into urlscan using the '|' opera‐
114 tor. This can be useful for applying a different flag (such as the '-d'
115 or '-c' options).
116
117
119 Run urlscan -g to generate ~/.config/urlscan/config.json. All of the
120 keys will be listed. You can either leave in place or delete any that
121 will not be altered.
122
123 To unset a binding, set it equal to "". For example: "P": ""
124
125 The follow actions are supported:
126
127 all_escape -- toggle unescape all URLs (Default: u)
128
129 all_shorten -- toggle shorten all URLs (Default: S)
130
131 bottom -- move cursor to last item (Default: G)
132
133 clear_screen -- redraw screen (Default: Ctrl-l)
134
135 clipboard -- copy highlighted URL to clipboard using xsel/xclip
136 (Default: C)
137
138 clipboard_pri -- copy highlighted URL to primary selection using
139 xsel/xclip (Default: P)
140
141 context -- show/hide context (Default: c)
142
143 down -- cursor down (Default: j)
144
145 help_menu -- show/hide help menu (Default: F1)
146
147 link_handler -- cycle link handling (webbrowser, xdg-open or custom)
148 (Default: l)
149
150 open_url -- open selected URL (Default: space or enter)
151
152 palette -- cycle through palettes (Default: p)
153
154 quit -- quit (Default: q or Q)
155
156 shorten -- toggle shorten highlighted URL (Default: s)
157
158 top -- move to first list item (Default: g)
159
160 up -- cursor up (Default: k)
161
162
164 $HOME/.config/urlscan/config.json
165
166 Only required if additional or modified palettes are desired.
167
168
170 /usr/share/doc/urlscan/README, urlview(1), mutt(1)
171
172
174 This manual page was written by Daniel Burrows <dburrows@debian.org>
175 and Scott Hansen <firecat4153@gmail.com>
176
177
178
179 May 29, 2019 URLSCAN(1)