Skip to content

Commit 0326e50

Browse files
authored
docs: document xterm-ghostty terminfo fix for sudo (#146)
* docs: document xterm-ghostty terminfo fix for sudo * docs: move troubleshooting content to TROUBLESHOOTING.md --------- Co-authored-by: Dino Korah <691011+codemedic@users.noreply.github.com>
1 parent 971e4bd commit 0326e50

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@ Since AppImages are self-contained executables, there is no formal installation
153153

154154
</details>
155155

156+
## 🛠️ Troubleshooting
157+
158+
See [TROUBLESHOOTING.md](TROUBLESHOOTING.md) for known issues and fixes.
159+
156160
## 🤝 Contributing
157161

158162
Contributions & Bugfixes are welcome. If you like to contribute, please feel free to fork the repository and submit a pull request.

TROUBLESHOOTING.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Troubleshooting
2+
3+
## `Error opening terminal: xterm-ghostty` when using `sudo`
4+
5+
Ghostty sets `TERM=xterm-ghostty`, but the terminfo entry is bundled inside the AppImage and is not installed on the host system. When you run a terminal application via `sudo` (e.g., `sudo aptitude`, `sudo vim`), the root environment cannot find the terminfo entry and fails with:
6+
7+
```
8+
Error opening terminal: xterm-ghostty.
9+
```
10+
11+
**Fix:** extract the terminfo entry from the AppImage and install it system-wide.
12+
13+
```bash
14+
# Extract the terminfo entry into a temporary directory
15+
tmpdir=$(mktemp -d /tmp/ghostty-appimage.XXXXXX)
16+
(cd "$tmpdir" && /path/to/Ghostty.AppImage --appimage-extract share/terminfo/x/xterm-ghostty)
17+
18+
# Install for the current user
19+
mkdir -p ~/.local/share/terminfo/x
20+
cp "$tmpdir/squashfs-root/share/terminfo/x/xterm-ghostty" ~/.local/share/terminfo/x/
21+
22+
# Install system-wide so root and sudo can find it
23+
sudo mkdir -p /usr/share/terminfo/x
24+
sudo cp "$tmpdir/squashfs-root/share/terminfo/x/xterm-ghostty" /usr/share/terminfo/x/
25+
26+
# Clean up
27+
rm -rf "$tmpdir"
28+
```
29+
30+
This only needs to be done once, or again after upgrading to a new AppImage release.

0 commit comments

Comments
 (0)