<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/url-mode.c, branch pixman-16f-2</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=pixman-16f-2</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=pixman-16f-2'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2025-05-01T11:53:11Z</updated>
<entry>
<title>Paste URL/regex selection to prompt if key is uppercase.</title>
<updated>2025-05-01T11:53:11Z</updated>
<author>
<name>Ryan Roden-Corrent</name>
<email>git@rrc.codes</email>
</author>
<published>2025-04-28T23:56:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0ea572dc63083e0d415382da2df8050a70f8cd07'/>
<id>urn:sha1:0ea572dc63083e0d415382da2df8050a70f8cd07</id>
<content type='text'>
In copy-regex/show-urls-copy mode, if the last input character was
uppercase, copy the selection to the clipboard _and_ paste it. This is
useful for taking a file path from a command output:(log, git, test
failure, etc.) and using it in another command.

This is inspired by the behavior of copy mode in wezterm:
https://wezterm.org/quickselect.html

I could have made it check every character in the hint, but it seemed
fine to assume that if the last character was uppercase, the user
wanted this behavior.

Closes #1975.
</content>
</entry>
<entry>
<title>url-mode: fix double-width characters not being handled correctly</title>
<updated>2025-04-13T06:28:13Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-04-13T06:26:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b93d2f042c378e9a2a6d0882c79331492d5dee09'/>
<id>urn:sha1:b93d2f042c378e9a2a6d0882c79331492d5dee09</id>
<content type='text'>
When a regex matches a string containing double-width characters, the
CELL_SPACER values were included in the URL string. This meant the
final URL (either launched, or copied) weren't handled correctly, as
invalid UTF-8 sequences were inserted in the middle of the string.

Closes #2027
</content>
</entry>
<entry>
<title>url-mode: fix crash when opening multiple urls with persist mode</title>
<updated>2025-03-20T07:52:10Z</updated>
<author>
<name>llyyr</name>
<email>llyyr.public@gmail.com</email>
</author>
<published>2025-03-19T04:36:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=cc99db5bc4f02fffe0dde7483fb91a8056e112d8'/>
<id>urn:sha1:cc99db5bc4f02fffe0dde7483fb91a8056e112d8</id>
<content type='text'>
Fixes: 051cd6ecfc8b98e1d80b399ebea40207fe040750
Closes #2000
</content>
</entry>
<entry>
<title>url-mode: regex: don't try to NULL-terminate an invalid vline</title>
<updated>2025-02-10T12:09:07Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-02-10T12:09:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c63202ee0ee45182ec5ab440262e63b85104e59e'/>
<id>urn:sha1:c63202ee0ee45182ec5ab440262e63b85104e59e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>url-mode: terminate last virtual line before regex matching</title>
<updated>2025-02-10T07:54:42Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-02-10T07:54:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=98db9658136cfc41b496b005c9df537f59aed6b8'/>
<id>urn:sha1:98db9658136cfc41b496b005c9df537f59aed6b8</id>
<content type='text'>
If the last line doesn't have a hard linebreak, it was never NULL
terminated, causing regexec() to crash on an out-of-bounds access.
</content>
</entry>
<entry>
<title>Fix URL detection regression on lines with NUL bytes</title>
<updated>2025-02-10T07:06:08Z</updated>
<author>
<name>Johannes Altmanninger</name>
<email>aclopte@gmail.com</email>
</author>
<published>2025-02-09T08:11:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4e5ad6e013666e4724b4de4273ac445adceb0865'/>
<id>urn:sha1:4e5ad6e013666e4724b4de4273ac445adceb0865</id>
<content type='text'>
Commit 859b4c89 (url-mode: wip: more work on regex matching,
2025-01-30) regressed URL detection in weechat. Some of the URLs
still work but others don't. This is because regexec() stops at the
first NUL, thus skipping the rest of the line. weechat seems create
NUL cells between their UI widgets.

Work around this by replacing NUL with space. This is probably correct
because selecting and copying those cells also translates to space
(not sure where in the code).
</content>
</entry>
<entry>
<title>url-mode: use the first *sub* expression as URL</title>
<updated>2025-02-05T12:35:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-02-03T12:56:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a984531ce57f30bc9ec7f664e7c2e8c77b3f439e'/>
<id>urn:sha1:a984531ce57f30bc9ec7f664e7c2e8c77b3f439e</id>
<content type='text'>
When auto-matching URLs (or custom regular expressions), use the
first *subexpression* as URL, rather than the while regex match.

This allows us to write custom regular expressions with prefix/suffix
strings that should not be included in the presented match.
</content>
</entry>
<entry>
<title>config+url: add support for user-defined regex patterns</title>
<updated>2025-02-05T12:35:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-02-03T07:55:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=051cd6ecfc8b98e1d80b399ebea40207fe040750'/>
<id>urn:sha1:051cd6ecfc8b98e1d80b399ebea40207fe040750</id>
<content type='text'>
Users can now define their own regex patterns, and use them via key
bindings:

    [regex:foo]
    regex=foo(bar)?
    launch=path-to-script-or-application {match}

    [key-bindings]
    regex-launch=[foo] Control+Shift+q
    regex-copy=[foo] Control+Mod1+Shift+q

That is, add a section called 'regex:', followed by an
identifier. Define a regex and a launcher command line.

Add a key-binding, regex-launch and/or regex-copy (similar to
show-urls-launch and show-urls-copy), and connect them to the regex
with the "[regex-name]" syntax (similar to how the pipe-* bindings
work).
</content>
</entry>
<entry>
<title>url-mode: regex: make sure there's always room for the NULL terminator</title>
<updated>2025-02-05T12:35:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-31T12:10:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ab4426f9873eee6d83871f9bd03d2d64a5f862b8'/>
<id>urn:sha1:ab4426f9873eee6d83871f9bd03d2d64a5f862b8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>url-mode+config: wip: add url.regex option</title>
<updated>2025-02-05T12:35:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-30T11:26:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d41b28bd027affe67bfd8032a2041241df8be823'/>
<id>urn:sha1:d41b28bd027affe67bfd8032a2041241df8be823</id>
<content type='text'>
</content>
</entry>
<entry>
<title>url-mode: wip: regex: tweak debug log message</title>
<updated>2025-02-05T12:35:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-30T10:55:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=05207fcde34d742f2e16e8ecfedd90f23a2f8849'/>
<id>urn:sha1:05207fcde34d742f2e16e8ecfedd90f23a2f8849</id>
<content type='text'>
</content>
</entry>
<entry>
<title>url-mode: wip: regex: mention changes from original regex</title>
<updated>2025-02-05T12:35:16Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-30T10:53:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=6d344f82ee151eb202dd786a63c12492f48fa4b8'/>
<id>urn:sha1:6d344f82ee151eb202dd786a63c12492f48fa4b8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>url-mode: wip: regex: don't allow {}, do allow matched []</title>
<updated>2025-02-05T12:35:16Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-30T10:52:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=031382f428d783cdf692cd17dac9489fb5c0b530'/>
<id>urn:sha1:031382f428d783cdf692cd17dac9489fb5c0b530</id>
<content type='text'>
</content>
</entry>
<entry>
<title>url-mode: wip: more work on regex matching</title>
<updated>2025-02-05T12:35:16Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-30T08:51:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=859b4c8921f5cde8cfc1f358e865ba417fe68a12'/>
<id>urn:sha1:859b4c8921f5cde8cfc1f358e865ba417fe68a12</id>
<content type='text'>
Remove the old auto-detection and instead use the regex matches.
</content>
</entry>
<entry>
<title>url-mode: wip: convert to regex matching for auto-detection</title>
<updated>2025-02-05T12:35:16Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-30T08:06:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1c15ee940d0063b7cfa11845c0af537d50ca8acd'/>
<id>urn:sha1:1c15ee940d0063b7cfa11845c0af537d50ca8acd</id>
<content type='text'>
</content>
</entry>
<entry>
<title>input: match unshifted key-bindings before shifted</title>
<updated>2025-01-31T08:07:42Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-31T08:07:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=51128a3484049e5f9b9b74276222977d12554d76'/>
<id>urn:sha1:51128a3484049e5f9b9b74276222977d12554d76</id>
<content type='text'>
That is, try to match e.g. Control+shift+a, before trying to match
Control+A.

In most cases, order doesn't matter. There are however a couple of
symbols where the layout consumes the shift-modifier, and the
generated symbol is the same in both the shifted and unshifted
form. One such example is backspace.

Before this patch, key-bindings with shift-backspace would be ignored,
if there were another key-binding with backspace.

So, for example, if we had one key-binding with Control+Backspace, and
another with Control+Shift+Backspace, the latter would never trigger,
as we would always match the first one.

By checking for unshifted matches first, we ensure
Control+Shift+Backspace does match.
</content>
</entry>
<entry>
<title>input: ignore key-bindings without modifiers when matching untranslated/raw</title>
<updated>2025-01-31T06:35:54Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-31T06:35:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=bee17a95b86a640522c25e650e13aebc82c7353d'/>
<id>urn:sha1:bee17a95b86a640522c25e650e13aebc82c7353d</id>
<content type='text'>
When matching the unshifted symbol, or the raw key code, ignore all
key bindings that don't have any modifiers.

This fixes an issue where it was impossible to enter (some of the)
numbers on the keypad, **if** there was a key-binding for
e.g. KP_Page_Up, or KP_Page_Down.
</content>
</entry>
<entry>
<title>key-bindings: try all bindings in translated mode before matching untranslated, and then finally raw</title>
<updated>2025-01-27T11:31:40Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-27T09:51:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8d6f0d0583a1cb7c245ff54ec472a03ebcdb6949'/>
<id>urn:sha1:8d6f0d0583a1cb7c245ff54ec472a03ebcdb6949</id>
<content type='text'>
When trying to match key bindings, we do three types of matching:

* Match the _translated_ symbol (e.g. Control+C)
* Match the _untranslated_ symbol (e.g. Control+Shift+c)
* Match raw keyboard codes

This was done for *each* key binding. This meant we sometimes matched
a keybinding in raw mode, even though there was a
translated/untranslated binding that would match it too. All depending
on the internal order of the key binding list.

This patch changes it, so that we first try all bindings in translated
mode, then all bindings in untranslated mode, and finally all bindings
in raw mode.

Closes #1929
</content>
</entry>
<entry>
<title>Revert "url-mode: don't strip the file:// prefix from localhost URIs"</title>
<updated>2024-10-23T06:46:30Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-10-23T06:46:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=996e5fa630b6275c598d8c2c573b9803b1752f83'/>
<id>urn:sha1:996e5fa630b6275c598d8c2c573b9803b1752f83</id>
<content type='text'>
This reverts commit 54722369d8ca0c6b90c6d874b0f712e133cd4925.
</content>
</entry>
<entry>
<title>spawn: add optional reaper callback, return pid_t</title>
<updated>2024-07-23T05:17:21Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-07-23T04:57:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a42f99081876dd02e28b931f7c0e70230355bb58'/>
<id>urn:sha1:a42f99081876dd02e28b931f7c0e70230355bb58</id>
<content type='text'>
This will allow spawn() callers to do things when the spawned process
has terminated.
</content>
</entry>
</feed>
