---
title: "Links"
description: "Opening URLs, files, and localhost ports straight out of the terminal."
---
Hold ⌘ (Ctrl on Windows and Linux) and links under the
pointer underline; click to open one.
## URLs
Anything that looks like a URL is detected, including one the shell wrapped
across two lines — tty7 stitches it back together before opening it.
Turn detection off with **Settings → Terminal → Links → Detect URLs**
(`link_url: false`).
## Files
A file path in the output — a compiler error, a test failure, a `grep -n` hit —
opens in tty7's own editor, on the line the link named, and the Files panel
selects it if it is open. A path to a directory opens the Files panel on it
instead.
Both absolute and relative paths are detected. A relative one is measured
against the directory the pane is working in, and then against the repository
around it — which is what makes a path a build tool printed from the workspace
root resolve while the shell sits in a member directory. A path that matches
nothing under either says so rather than doing nothing.
Paths in a pane connected to another machine are resolved *on that machine*,
so the underline appears a moment after the pointer settles rather than
instantly. A pane running `ssh` typed into a local shell has no host that can
answer for its paths, so file links are off there.
**Settings → Terminal → Links → Open files with** picks what a click opens:
| Mode | Opens in |
| --- | --- |
| Built-in editor | tty7's editor, at `:line:column`. The default. |
| Default app | Whatever the OS associates with the file type. |
| Command | A command of your own — see below. |
A file on another machine always opens in the built-in editor, whichever mode
is set: a path that was just resolved on the far side means nothing to a local
`open` or `code`, which would show this machine's copy of that path or nothing
at all.
Under **Command**, the command runs with placeholders substituted:
```
code --goto {path}:{line}:{column}
zed {path}:{line}
herdr edit {path} --line={line}
```
`{path}`, `{line}`, and `{column}` are filled in from the link. A flag whose
value is not available is dropped rather than passed empty — so
`--line={line}` simply disappears when the link had no line number.
The settings are `link_file_open` (`internal`, `system`, or `command`) and
`link_file_command` in `config.json`. A config written before `link_file_open`
existed keeps working: one that set a command stays on **Command**, and one
that did not moves to the built-in editor.
## localhost ports
⌘-clicking `localhost:3000` opens it in your browser, which is only
useful if the server is on this machine.
When the pane is inside an SSH session it usually is not, so tty7 opens a port
forward through that connection first and points the browser at the local end.
The forward is built on the click if it is not there already.
This is on by default; **Settings → Terminal → Links → Forward remote ports**
(`ssh_loopback_forward`) turns it off, along with the automatic forwarding of
ports a remote pane starts serving.
Every port a remote pane is listening on is listed in the Info panel, whether
or not its URL was ever printed — see [port
forwarding](/remote/port-forwarding).