diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-03-10 14:59:14 +0100 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-03-10 14:59:14 +0100 |
| commit | 1100562e29f6476448b656dbddd4cf22505523f6 (patch) | |
| tree | 442eec492199104bd49dfd74474ce89ade8fcac9 /content/notes/2023-06-25-alacritty-open-links-with-modifier.md | |
| parent | a40d80be378e46a6c490e1b99b0d8f4acd968503 (diff) | |
| download | mitjafelicijan.com-1100562e29f6476448b656dbddd4cf22505523f6.tar.gz | |
Move back to JBMAFP
Diffstat (limited to 'content/notes/2023-06-25-alacritty-open-links-with-modifier.md')
| -rw-r--r-- | content/notes/2023-06-25-alacritty-open-links-with-modifier.md | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/content/notes/2023-06-25-alacritty-open-links-with-modifier.md b/content/notes/2023-06-25-alacritty-open-links-with-modifier.md new file mode 100644 index 0000000..c805053 --- /dev/null +++ b/content/notes/2023-06-25-alacritty-open-links-with-modifier.md | |||
| @@ -0,0 +1,34 @@ | |||
| 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: note | ||
| 6 | draft: false | ||
| 7 | --- | ||
| 8 | |||
| 9 | Alacritty by default makes all links in the terminal output clickable and this | ||
| 10 | gets annoying rather quickly. I liked the default behavior of Gnome terminal | ||
| 11 | where you needed to hold Control key and then you could click and open links. | ||
| 12 | |||
| 13 | To achieve this in Alacritty you need to provide a `hint` in the configuration | ||
| 14 | file. Config file is located at `~/.config/alacritty/alacritty.yml`. | ||
| 15 | |||
| 16 | ```yaml | ||
| 17 | hints: | ||
| 18 | enabled: | ||
| 19 | - regex: "(mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)\ | ||
| 20 | [^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+" | ||
| 21 | command: xdg-open | ||
| 22 | post_processing: true | ||
| 23 | mouse: | ||
| 24 | enabled: true | ||
| 25 | mods: Control | ||
| 26 | ``` | ||
| 27 | |||
| 28 | The following should work under any Linux system. For macOS, you will need to | ||
| 29 | change `command: xdg-open` to something else. | ||
| 30 | |||
| 31 | Now the links will be visible and clickable only when Control key is being | ||
| 32 | pressed. | ||
| 33 | |||
| 34 | Source: https://github.com/alacritty/alacritty/issues/5246 | ||
