aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-11-13 18:49:58 +0100
committerbptato <nincsnevem662@gmail.com>2024-11-13 19:24:38 +0100
commit0a892537871aa8cea8ecd76d1b2e307e413b696f (patch)
treebf0bb42442dc0e9731b9909a2abc7bbc732df4fa /doc
parentb16d3454ea16d87b84607e8330ca3c3b0ac0a8f7 (diff)
downloadchawan-0a892537871aa8cea8ecd76d1b2e307e413b696f.tar.gz
config: resolve download-dir as path, update docs
Turns out it's more useful to have env vars in the variable than to allow incomplete path names. Also, fix the disappearing backslash issue in docs.
Diffstat (limited to 'doc')
-rw-r--r--doc/cha-api.54
-rw-r--r--doc/cha-config.531
-rw-r--r--doc/cha-mailcap.53
-rw-r--r--doc/cha-protocols.58
-rw-r--r--doc/cha-troubleshooting.526
-rw-r--r--doc/config.md5
-rw-r--r--doc/troubleshooting.md26
7 files changed, 73 insertions, 30 deletions
diff --git a/doc/cha-api.5 b/doc/cha-api.5
index 9343d33f..b119aa9e 100644
--- a/doc/cha-api.5
+++ b/doc/cha-api.5
@@ -112,7 +112,7 @@ with the default scheme/local files, etc.
Opens a prompt with the current URL when no parameters are specified;
otherwise, the string passed is displayed in the prompt.
If this string ends with a newline
-(e.g.\ \f[CR]pager.load(\[dq]about:chawann\[dq])\f[R]), the URL is
+(e.g.\ \f[CR]pager.load(\[dq]about:chawan\[rs]n\[dq])\f[R]), the URL is
loaded directly.
T}@T{
T}
@@ -120,7 +120,7 @@ T{
\f[CR]loadSubmit(url)\f[R]
T}@T{
Act as if \f[CR]url\f[R] had been input into the address bar.
-Same as \f[CR]pager.load(url + \[dq]n\[dq])\f[R].
+Same as \f[CR]pager.load(url + \[dq]\[rs]n\[dq])\f[R].
T}@T{
T}
T{
diff --git a/doc/cha-config.5 b/doc/cha-config.5
index 3a0d4f1a..d1ee3404 100644
--- a/doc/cha-config.5
+++ b/doc/cha-config.5
@@ -240,8 +240,8 @@ When set to \[lq]auto\[rq], searches are only case\-sensitive when the
search term includes a capital letter.
Defaults to \[lq]auto\[rq].
Note: this can also be overridden inline in the search bar (vim\-style),
-with the escape sequences \f[CR]c\f[R] (ignore case) and \f[CR]C\f[R]
-(strict case).
+with the escape sequences \f[CR]\[rs]c\f[R] (ignore case) and
+\f[CR]\[rs]C\f[R] (strict case).
See search mode for details.)
T}@T{
T}
@@ -381,10 +381,9 @@ T}
T{
download\-dir
T}@T{
-string
+path
T}@T{
Path to pre\-fill for \[lq]Save to:\[rq] prompts.
-This is not validated, you can set it to whatever you find useful.
T}@T{
T}
.TE
@@ -794,12 +793,12 @@ Examples:
.EX
# Enable cookies on the orange website for log\-in.
[[siteconf]]
-url = \[aq]https://news.ycombinator.com/.*\[aq]
+url = \[aq]https://news\[rs].ycombinator\[rs].com/.*\[aq]
cookie = true
# Redirect npr.org to text.npr.org.
[[siteconf]]
-host = \[aq](www.)?npr.org\[aq]
+host = \[aq](www\[rs].)?npr\[rs].org\[aq]
rewrite\-url = \[aq]\[aq]\[aq]
(x) => {
x.host = \[dq]text.npr.org\[dq];
@@ -811,19 +810,19 @@ x.pathname = s.at(s.length > 2 ? \-2 : 1);
# Allow cookie sharing on *sr.ht domains.
[[siteconf]]
-host = \[aq](.*.)?sr.ht\[aq] # either \[aq]something.sr.ht\[aq] or \[aq]sr.ht\[aq]
+host = \[aq](.*\[rs].)?sr\[rs].ht\[aq] # either \[aq]something.sr.ht\[aq] or \[aq]sr.ht\[aq]
cookie = true # enable cookies
share\-cookie\-jar = \[aq]sr.ht\[aq] # use the cookie jar of \[aq]sr.ht\[aq] for all matched hosts
-third\-party\-cookie = \[aq].*.sr.ht\[aq] # allow cookies from subdomains
+third\-party\-cookie = \[aq].*\[rs].sr\[rs].ht\[aq] # allow cookies from subdomains
-# Use the \[dq]vector\[dq] skin on Wikipedia, which Chawan can handle better.
+# Use the \[dq]vector\[dq] skin on Wikipedia.
[[siteconf]]
-url = \[aq]\[ha]https?://[a\-z]+.wikipedia.org/wiki/(?!.*useskin=.*)\[aq]
+url = \[aq]\[ha]https?://[a\-z]+\[rs].wikipedia\[rs].org/wiki/(?!.*useskin=.*)\[aq]
rewrite\-url = \[aq]x => x.searchParams.append(\[dq]useskin\[dq], \[dq]vector\[dq])\[aq]
# Make imgur send us images.
[[siteconf]]
-host = \[aq](i.)?imgur.com\[aq]
+host = \[aq](i\[rs].)?imgur\[rs].com\[aq]
default\-headers = {
User\-Agent = \[dq]Mozilla/5.0 chawan\[dq],
Accept = \[dq]*/*\[dq],
@@ -1057,7 +1056,7 @@ with or without modifiers.
Modifiers are the prefixes \f[CR]C\-\f[R] and \f[CR]M\-\f[R], which add
control or escape to the keybinding respectively (essentially making
\f[CR]M\-\f[R] the same as \f[CR]C\-[\f[R]).
-Modifiers can be escaped with the \[ga]\[ga] sign.
+Modifiers can be escaped with the \f[CR]\[rs]\f[R] sign.
.PP
\f[CR]<action>\f[R] is either a command defined in the \f[CR][cmd]\f[R]
section, or a JavaScript expression.
@@ -1797,16 +1796,16 @@ lines.
.PP
\[lq]Search\[rq] mode also has some other convenience transformations:
.IP \[bu] 2
-The string \f[CR]c\f[R] (backslash + lower\-case c) inside a
+The string \f[CR]\[rs]c\f[R] (backslash + lower\-case c) inside a
search\-mode regex enables case\-insensitive matching.
.IP \[bu] 2
-Conversely, \f[CR]C\f[R] (backslash + capital C) disables
+Conversely, \f[CR]\[rs]C\f[R] (backslash + capital C) disables
case\-insensitive matching.
(Useful if you have \f[CR]ignore\-case\f[R] set to true, which is the
default.)
.IP \[bu] 2
-\f[CR]<\f[R] and \f[CR]>\f[R] is converted to \f[CR]b\f[R] (as in vi,
-grep, etc.)
+\f[CR]\[rs]<\f[R] and \f[CR]\[rs]>\f[R] is converted to
+\f[CR]\[rs]b\f[R] (as in vi, grep, etc.)
.PP
Note that none of these work in \[lq]match\[rq] mode.
.SS Path handling
diff --git a/doc/cha-mailcap.5 b/doc/cha-mailcap.5
index d6c62df8..a77dfbf6 100644
--- a/doc/cha-mailcap.5
+++ b/doc/cha-mailcap.5
@@ -138,7 +138,8 @@ application/x\-troff\-man; pandoc \- \-f man \-t html \-o \-; x\-htmloutput
# epub \-> HTML using pandoc. (Again, don\[aq]t forget to adjust mime.types.)
# We set http_proxy to keep it from downloading whatever through http/s.
-application/epub+zip; http_proxy=localhost:0 pandoc \- \-f epub \-\-embed\-resources \-\-standalone; x\-htmloutput
+application/epub+zip; http_proxy=localhost:0 pandoc \- \-f epub \[rs]
+\-\-embed\-resources \-\-standalone; x\-htmloutput
# Following entry will be ignored, as text/html is supported natively by Chawan.
text/html; cha \-dT text/html \-I %{charset}; copiousoutput
diff --git a/doc/cha-protocols.5 b/doc/cha-protocols.5
index 33a6b863..809f718a 100644
--- a/doc/cha-protocols.5
+++ b/doc/cha-protocols.5
@@ -197,7 +197,7 @@ of waiting.
\f[I]# We are going to wait a second from now, but want Chawan to show\f[R]
\f[I]# \[dq]Downloading...\[dq] instead of \[dq]Connecting...\[dq]. So signal to the browser that the\f[R]
\f[I]# connection has succeeded.\f[R]
-printf \[aq]Cha\-Control: Connectedn\[aq]
+printf \[aq]Cha\-Control: Connected\[rs]n\[aq]
sleep 1 \f[I]# sleep\f[R]
\f[I]# Status is a special header that signals the equivalent HTTP status code.\f[R]
printf \[aq]Status: 200\[aq] \f[I]# HTTP OK\f[R]
@@ -206,13 +206,13 @@ printf \[aq]Status: 200\[aq] \f[I]# HTTP OK\f[R]
\f[I]# be an attack vector to simply send the headers without ControlDone, as nothing\f[R]
\f[I]# stops the website from sending a Cha\-Control header. With ControlDone sent,\f[R]
\f[I]# even Cha\-Control headers will be interpreted as regular headers.\f[R]
-printf \[aq]Cha\-Control: ControlDonen\[aq]
+printf \[aq]Cha\-Control: ControlDone\[rs]n\[aq]
\f[I]# As in HTTP, you must send an empty line before the body.\f[R]
-printf \[aq]n\[aq]
+printf \[aq]\[rs]n\[aq]
\f[I]# Now, print the body. We take the path passed to the URL; urimethodmap\f[R]
\f[I]# sets this as MAPPED_URI_PATH. This is URI\-encoded, so we also run the urldec\f[R]
\f[I]# utility on it.\f[R]
-cowsay \[dq]$(printf \[aq]%sn\[aq] \[dq]$MAPPED_URI_PATH\[dq] \f[B]|\f[R] \[dq]$CHA_LIBEXEC_DIR\[dq]/urldec)\[dq]
+cowsay \[dq]$(printf \[aq]%s\[rs]n\[aq] \[dq]$MAPPED_URI_PATH\[dq] \f[B]|\f[R] \[dq]$CHA_LIBEXEC_DIR\[dq]/urldec)\[dq]
.EE
.PP
Now, create a \[lq].urimethodmap\[rq] file in your \f[CR]$HOME\f[R]
diff --git a/doc/cha-troubleshooting.5 b/doc/cha-troubleshooting.5
index dfdf42c2..26e9b791 100644
--- a/doc/cha-troubleshooting.5
+++ b/doc/cha-troubleshooting.5
@@ -61,7 +61,7 @@ To fix this, put a script somewhere in your \f[CR]PATH\f[R]:
exec cha \-T text/x\-ansi \[dq]$\[at]\[dq]
.EE
.PP
-and \f[CR]export PAGER=pcha\f[R].
+and \f[CR]export PAGER=pcha\f[R] (or whatever you named the script).
.SS How do I view text files with wrapping?
By default, text files are not auto\-wrapped, so viewing plain text
files that were not wrapped properly by the authors is somewhat
@@ -100,7 +100,7 @@ rdrview
\&.
Then bind the following command to a key of your choice in the config
(e.g.\ \f[CR]<space> r\f[R]):
-\f[CR]\[aq] r\[aq] = \[dq]pager.externFilterSource(\[aq]rdrview \-H \-u \[dq]$CHA_URL\[dq]\[aq])\[dq]\f[R]
+\f[CR]\[aq] r\[aq] = \[dq]pager.externFilterSource(\[aq]rdrview \-Hu \[rs]\[dq]$CHA_URL\[rs]\[dq]\[aq])\[dq]\f[R]
This does not fix the core problem, but will significantly improve your
reading experience anyway.
.IP "2." 3
@@ -134,5 +134,27 @@ follow step 3.
of the previous answer.
Warning: remote JavaScript execution is inherently unsafe.
Please only enable JavaScript on websites you trust.
+.SS Text areas discard my edits when I type C\-c in my editor!
+This is a bug in your shell: \c
+.UR https://people.freebsd.org/~cracauer/homepage-mirror/sigint.html
+.UE \c
+.PP
+When Chawan runs an external text editor, it simply passes the
+\f[CR]$EDITOR\f[R] command to the shell, and then examines its \f[I]wait
+status\f[R] to determine if your editor exited gracefully.
+This works if either the editor never receives a signal, or your shell
+implements WCE.
+.PP
+However, if the editor (e.g.\ nvi) catches SIGINT on C\-c, and the shell
+reports that the program was killed by a signal (WUE), then Chawan will
+discard your changes (as it believes that the program has crashed).
+.PP
+The easiest workaround is to remove the shell from the equation using
+\f[CR]exec\f[R]:
+.IP
+.EX
+[external]
+editor = \[aq]exec vi +%d\[aq]
+.EE
.SS See also
\f[B]cha\f[R](1)
diff --git a/doc/config.md b/doc/config.md
index 5316679f..e2c01347 100644
--- a/doc/config.md
+++ b/doc/config.md
@@ -345,9 +345,8 @@ details, see <!-- MANOFF -->[localcgi.md](localcgi.md).<!-- MANON -->
<tr>
<td>download-dir</td>
-<td>string</td>
-<td>Path to pre-fill for "Save to:" prompts. This is not validated, you can set
-it to whatever you find useful.</td>
+<td>path</td>
+<td>Path to pre-fill for "Save to:" prompts.</td>
</tr>
</table>
diff --git a/doc/troubleshooting.md b/doc/troubleshooting.md
index 13600a9e..b1274eb8 100644
--- a/doc/troubleshooting.md
+++ b/doc/troubleshooting.md
@@ -57,7 +57,7 @@ this, put a script somewhere in your `PATH`:
exec cha -T text/x-ansi "$@"
```
-and `export PAGER=pcha`.
+and `export PAGER=pcha` (or whatever you named the script).
## How do I view text files with wrapping?
@@ -95,7 +95,7 @@ There are three ways of dealing with this:
[rdrview](https://github.com/eafer/rdrview). Then bind the following command
to a key of your choice in the [config](config.md#keybindings)
(e.g. `<space> r`):<br>
- `' r' = "pager.externFilterSource('rdrview -H -u \"$CHA_URL\"')"`<br>
+ `' r' = "pager.externFilterSource('rdrview -Hu \"$CHA_URL\"')"`<br>
This does not fix the core problem, but will significantly improve your
reading experience anyway.
2. Complain [here](https://todo.sr.ht/~bptato/chawan), and wait until the
@@ -118,6 +118,28 @@ Some potential fixes:
Warning: remote JavaScript execution is inherently unsafe. Please only enable
JavaScript on websites you trust.
+## Text areas discard my edits when I type C-c in my editor!
+
+This is a bug in your shell:
+<https://people.freebsd.org/~cracauer/homepage-mirror/sigint.html>
+
+When Chawan runs an external text editor, it simply passes the `$EDITOR`
+command to the shell, and then examines its *wait status* to determine
+if your editor exited gracefully. This works if either the editor never
+receives a signal, or your shell implements WCE.
+
+However, if the editor (e.g. nvi) catches SIGINT on C-c, and the shell
+reports that the program was killed by a signal (WUE), then Chawan will
+discard your changes (as it believes that the program has crashed).
+
+The easiest workaround is to remove the shell from the equation using
+`exec`:
+
+```sh
+[external]
+editor = 'exec vi +%d'
+```
+
<!-- MANON
## See also