Skip to content

Commit 165ddb3

Browse files
committed
Add xterm-rio terminfo entry for better application compatibility
- Add xterm-rio as primary terminfo entry with rio as alias - Applications that look for 'xterm-' prefixed terminals now work correctly - Maintains TERM=rio environment variable for consistency - Fixes crashes with termwiz-based applications like gitu - Follows same pattern as other modern terminals (Alacritty, Ghostty) - Updated build files and documentation to use both terminfo entries Fixes #1190
1 parent 71a8568 commit 165ddb3

File tree

7 files changed

+26
-8
lines changed

7 files changed

+26
-8
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ $(APP_NAME)-%: $(TARGET)-%
7171
@touch -r "$(APP_BINARY)" "$(TARGET_DIR_OSX)/$(APP_NAME)"
7272

7373
install-terminfo:
74-
@tic -xe rio -o $(APP_EXTRAS_DIR) $(TERMINFO)
74+
@tic -xe xterm-rio,rio -o $(APP_EXTRAS_DIR) $(TERMINFO)
7575

7676
release-macos: app-universal
7777
@codesign --remove-signature "$(TARGET_DIR_OSX)/$(APP_NAME)"

docs/docs/install/linux.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ If the command returns an error, install the terminfo manually:
9292

9393
```bash
9494
curl -o rio.terminfo https://raw.githubusercontent.com/raphamorim/rio/main/misc/rio.terminfo
95-
sudo tic -xe rio rio.terminfo
95+
sudo tic -xe xterm-rio,rio rio.terminfo
9696
rm rio.terminfo
9797
```
9898

docs/docs/install/terminfo.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: 'Terminfo'
33
language: 'en'
44
---
55

6-
To make sure Rio works correctly, the "rio" terminfo must be used. The rio terminfo will be picked up automatically if it is installed.
6+
To make sure Rio works correctly, the Rio terminfo must be used. The rio terminfo will be picked up automatically if it is installed.
77

88
If the following command returns without any errors, the rio terminfo is already installed:
99

@@ -13,12 +13,21 @@ infocmp rio
1313

1414
If it is not present already, you can install it globally with the following command:
1515

16-
When cloned locally, from the root of the repository run `sudo tic -xe rio misc/rio.terminfo`
16+
When cloned locally, from the root of the repository run `sudo tic -xe xterm-rio,rio misc/rio.terminfo`
1717

1818
If the source code has not been cloned locally:
1919

2020
```sh
2121
curl -o rio.terminfo https://raw.githubusercontent.com/raphamorim/rio/main/misc/rio.terminfo
22-
sudo tic -xe rio rio.terminfo
22+
sudo tic -xe xterm-rio,rio rio.terminfo
2323
rm rio.terminfo
2424
```
25+
26+
## Terminfo Entries
27+
28+
The Rio terminfo provides two entries:
29+
30+
- `rio`: The primary terminfo entry used by the `TERM` environment variable
31+
- `xterm-rio`: A compatibility entry for applications that look for "xterm-" prefixed terminals to detect capabilities
32+
33+
Both entries provide the same terminal capabilities, ensuring compatibility with a wide range of applications.

docs/docs/releases.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ language: 'en'
109109
- `man 5 rio` - Complete configuration file format documentation
110110
- `man 5 rio-bindings` - Key bindings reference and customization guide
111111
- Available in `extra/man/` directory with build instructions
112+
- **Terminfo Compatibility**: Improved terminal compatibility by adding `xterm-rio` terminfo entry
113+
- Added `xterm-rio` as primary terminfo entry with `rio` as alias for better application compatibility
114+
- Applications that look for "xterm-" prefixed terminals (like termwiz-based apps) now work correctly
115+
- Maintains `TERM=rio` environment variable for consistency with terminal identity
116+
- Fixes crashes with applications like `gitu` and other termwiz-based terminal programs
117+
- Follows same pattern as other modern terminals (Alacritty, Ghostty) for maximum compatibility
112118

113119
### Technical Details
114120

frontends/rioterm/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const LOG_LEVEL_ENV: &str = "RIO_LOG_LEVEL";
4141

4242
pub fn setup_environment_variables(config: &rio_backend::config::Config) {
4343
#[cfg(unix)]
44-
let terminfo = if teletypewriter::terminfo_exists("rio") {
44+
let terminfo = if teletypewriter::terminfo_exists("rio") || teletypewriter::terminfo_exists("xterm-rio") {
4545
"rio"
4646
} else {
4747
"xterm-256color"

misc/rio.terminfo

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
rio,
1+
xterm-rio,
22
use=rio+base,
3+
4+
rio,
5+
use=xterm-rio,
36
rs1=\Ec\E]104\007,
47
ccc,
58
colors#0x100, pairs#0x7FFF,

pkgRio.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ in
8484
8585
# Install terminfo files
8686
install -dm 755 "$out/share/terminfo/r/"
87-
tic -xe rio,rio-direct -o "$out/share/terminfo" misc/rio.terminfo
87+
tic -xe xterm-rio,rio,rio-direct -o "$out/share/terminfo" misc/rio.terminfo
8888
'' + lib.optionalString stdenv.hostPlatform.isDarwin ''
8989
mkdir $out/Applications/
9090
mv misc/osx/Rio.app/ $out/Applications/

0 commit comments

Comments
 (0)