diff options
Diffstat (limited to 'content/notes/alacritty-open-links-with-modifier.md')
| -rw-r--r-- | content/notes/alacritty-open-links-with-modifier.md | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/content/notes/alacritty-open-links-with-modifier.md b/content/notes/alacritty-open-links-with-modifier.md new file mode 100644 index 0000000..2ec1d59 --- /dev/null +++ b/content/notes/alacritty-open-links-with-modifier.md | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | --- | ||
| 2 | title: "Alacritty open links with modifier" | ||
| 3 | url: alacritty-open-links-with-modifier.html | ||
| 4 | date: 2023-06-25T17:17:16+02:00 | ||
| 5 | type: notes | ||
| 6 | draft: false | ||
| 7 | tags: [linux] | ||
| 8 | --- | ||
| 9 | |||
| 10 | Alacritty by default makes all links in the terminal output clickable and this | ||
| 11 | gets annoying rather quickly. I liked the default behavior of Gnome terminal | ||
| 12 | where you needed to hold Control key and then you could click and open links. | ||
| 13 | |||
| 14 | To achieve this in Alacritty you need to provide a `hint` in the configuration | ||
| 15 | file. Config file is located at `~/.config/alacritty/alacritty.yml`. | ||
| 16 | |||
| 17 | ```yaml | ||
| 18 | hints: | ||
| 19 | enabled: | ||
| 20 | - regex: "(mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)\ | ||
| 21 | [^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+" | ||
| 22 | command: xdg-open | ||
| 23 | post_processing: true | ||
| 24 | mouse: | ||
| 25 | enabled: true | ||
| 26 | mods: Control | ||
| 27 | ``` | ||
| 28 | |||
| 29 | The following should work under any Linux system. For macOS, you will need to | ||
| 30 | change `command: xdg-open` to something else. | ||
| 31 | |||
| 32 | Now the links will be visible and clickable only when Control key is being | ||
| 33 | pressed. | ||
| 34 | |||
| 35 | Source: https://github.com/alacritty/alacritty/issues/5246 | ||
