1---
 2title: "Alacritty open links with modifier"
 3url: alacritty-open-links-with-modifier.html
 4date: 2023-06-25T17:17:16+02:00
 5type: note
 6draft: false
 7---
 8
 9Alacritty by default makes all links in the terminal output clickable and this
10gets annoying rather quickly. I liked the default behavior of Gnome terminal
11where you needed to hold Control key and then you could click and open links.
12
13To achieve this in Alacritty you need to provide a `hint` in the configuration
14file. Config file is located at `~/.config/alacritty/alacritty.yml`.
15
16```yaml
17hints:
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
28The following should work under any Linux system. For macOS, you will need to
29change `command: xdg-open` to something else.
30
31Now the links will be visible and clickable only when Control key is being
32pressed.
33
34Source: https://github.com/alacritty/alacritty/issues/5246