Skip to content

Commit d9f5a84

Browse files
authored
feat: add XTVERSION support (#1347)
* feat: add XTVERSION support * docs: update changelog
1 parent 9cfe704 commit d9f5a84

File tree

3 files changed

+76
-39
lines changed

3 files changed

+76
-39
lines changed

docs/src/pages/changelog.md

Lines changed: 55 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ language: 'en'
1313
- Kitty image protocol.
1414
- Breaking: `Decorations` as `Transparent` is default on MacOS (instead of `Enabled`).
1515

16+
## 0.2.33 (unreleased)
17+
18+
- Support reporting terminal version via XTVERSION.
19+
20+
## 0.2.32
21+
22+
- Updated WGPU to v27.0.1.
23+
- Fix No backend are enabled on FreeBSD #1235.
24+
1625
## 0.2.31
1726

1827
- Update Rust to v1.90.
@@ -138,7 +147,7 @@ language: 'en'
138147
- Programming keywords: `const`, `let`, `function`, `class`, `import`, `export`, etc.
139148
- Indentation patterns: 4/8/12/16 spaces, single/double/triple tabs
140149
- Shell commands: `ls`, `cd`, `git`, `npm`, `cargo`, `sudo`, etc.
141-
- Operators & punctuation: ` = `, ` == `, ` => `, `();`, `{}`, `[]`, etc.
150+
- Operators & punctuation: `=`, `==`, `=>`, `();`, `{}`, `[]`, etc.
142151
- File extensions: `.js`, `.ts`, `.rs`, `.py`, `.json`, `.md`, etc.
143152
- Error/log patterns: `Error:`, `[INFO]`, `FAILED`, `SUCCESS`, etc.
144153
- Immediate cache hits eliminate cold start shaping delays
@@ -183,7 +192,7 @@ language: 'en'
183192
- Shift+clicking now extends the current selection to the clicked cell
184193
- Provides standard terminal selection behavior expected by users
185194
- Regular clicking without Shift still clears selection and starts new one as before
186-
- **CLI accepts relative paths for working directory CLI argument**: When invoking rio from other terminals using `rio --working-dir=<path>`, a relative path is now correctly processed
195+
- **CLI accepts relative paths for working directory CLI argument**: When invoking rio from other terminals using `rio --working-dir=<path>`, a relative path is now correctly processed
187196

188197
### Bug Fixes
189198

@@ -235,6 +244,7 @@ The performance optimizations in this release represent a significant architectu
235244
- **Compatibility**: All optimizations maintain full backward compatibility with existing Rio APIs and configurations.
236245

237246
These changes are particularly beneficial for:
247+
238248
- Programming workflows with repetitive code patterns
239249
- Terminal sessions with heavy indentation (Python, nested JS/TS, YAML)
240250
- Long-running sessions where cache warming provides sustained performance benefits
@@ -243,7 +253,7 @@ These changes are particularly beneficial for:
243253
### Bug Fixes
244254

245255
- **Backspace Key Compatibility**: Fixed backspace key not working properly in vim when `TERM=xterm-256color`
246-
- Changed backspace key bindings to send BS (0x08) instead of DEL (0x7F)
256+
- Changed backspace key bindings to send BS (0x08) instead of DEL (0x7F)
247257
- Updated Rio terminfo and termcap entries to match actual key behavior
248258
- Updated XTGETTCAP response to return `^H` for `kbs` capability
249259
- Ensures compatibility with applications expecting xterm-256color backspace behavior
@@ -275,15 +285,15 @@ These changes are particularly beneficial for:
275285

276286
## 0.2.17
277287

278-
- *Breaking:* Decorations as `Enabled` is default on MacOS (instead of `Transparent`).
288+
- _Breaking:_ Decorations as `Enabled` is default on MacOS (instead of `Transparent`).
279289
- F16 Texture supports whenever is available.
280290
- Clear font atlas whenever the font is changed.
281291
- Skip passing sandbox env in Flatpak, fixes user environment in spawned shell [#1116](https://github.com/raphamorim/rio/pull/1116) by [@ranisalt](https://github.com/ranisalt).
282292
- On Windows, fixed crash in should_apps_use_dark_mode() for Windows versions < 17763.
283293

284294
## 0.2.16
285295

286-
- *Breaking*: support reading from config directory using `$XDG_CONFIG_HOME` on Linux [#1105](https://github.com/raphamorim/rio/pull/1105) by [@ranisalt](https://github.com/ranisalt).
296+
- _Breaking_: support reading from config directory using `$XDG_CONFIG_HOME` on Linux [#1105](https://github.com/raphamorim/rio/pull/1105) by [@ranisalt](https://github.com/ranisalt).
287297
- Fix: Crash on whenever attempting to clean an invalid line index.
288298
- Add metainfo and screenshots for appstream by [@ranisalt](https://github.com/ranisalt).
289299

@@ -298,7 +308,7 @@ These changes are particularly beneficial for:
298308

299309
## 0.2.13
300310

301-
- *Breaking change*: For Windows and Linux users, hyperlink trigger whenever hovering a link was changed from `alt` to `shift`.
311+
- _Breaking change_: For Windows and Linux users, hyperlink trigger whenever hovering a link was changed from `alt` to `shift`.
302312
- Fix dimension for whenever a new tab is created from a view with splits.
303313
- Drop subtables with empty coverage by [@xorgy](https://github.com/xorgy).
304314
- Fix font size affecting tabs size.
@@ -339,7 +349,7 @@ These changes are particularly beneficial for:
339349
- Fix dimension computation whenever resizing Rio.
340350
- Removed `fonts.ui` property, now Rio will always use primary font for UI.
341351
- Removed Text renderer mod by migrating to RichText renderer.
342-
- *Breaking:* `renderer.strategy = "Continuous"` was renamed to `renderer.strategy = "Game"`
352+
- _Breaking:_ `renderer.strategy = "Continuous"` was renamed to `renderer.strategy = "Game"`
343353
- Fix search bar can't show chinese [#844](https://github.com/raphamorim/rio/issues/844).
344354

345355
## 0.2.10
@@ -353,10 +363,12 @@ These changes are particularly beneficial for:
353363
## 0.2.9
354364

355365
- Support to symbol map configuration: `fonts.symbol-map`:
366+
356367
```toml
357368
# covers: '⊗','⊘','⊙'
358369
fonts.symbol-map = [{ start = "2297", end = "2299", font-family = "Cascadia Code NF" }]
359370
```
371+
360372
- Add Switch to Next/Prev Split or Tab command by [@vlabo](https://github.com/vlabo).
361373
- Fix issue whenever the first main font cannot be found.
362374

@@ -367,7 +379,7 @@ fonts.symbol-map = [{ start = "2297", end = "2299", font-family = "Cascadia Code
367379
- Use [GoReleaser](https://goreleaser.com) to build & release Rio ([#921](https://github.com/raphamorim/rio/pull/921)), thanks [@caarlos0](https://github.com/caarlos0) and [@vedantmgoyal9](https://github.com/vedantmgoyal9)
368380
- Cache GSUB and GPOS features independently.
369381
- Updated `windows-sys` to `v0.59`.
370-
- To match the corresponding changes in `windows-sys`, the `HWND`, `HMONITOR`, and `HMENU` types now alias to `*mut c_void` instead of `isize`.
382+
- To match the corresponding changes in `windows-sys`, the `HWND`, `HMONITOR`, and `HMENU` types now alias to `*mut c_void` instead of `isize`.
371383

372384
## 0.2.7
373385

@@ -408,13 +420,13 @@ fonts.symbol-map = [{ start = "2297", end = "2299", font-family = "Cascadia Code
408420
## 0.2.3
409421

410422
- Rio now allows you to configure window title through configuration via template. Possible options:
411-
- `TITLE`: terminal title via OSC sequences for setting terminal title
412-
- `PROGRAM`: (e.g `fish`, `zsh`, `bash`, `vim`, etc...)
413-
- `ABSOLUTE_PATH`: (e.g `/Users/rapha/Documents/a/rio`)
414-
<!-- - `CANONICAL_PATH`: (e.g `.../Documents/a/rio`, `~/Documents/a`) -->
415-
- `COLUMNS`: current columns
416-
- `LINES`: current lines
417-
- So, for example if you have: `{{COLUMNS}}x{{LINES}}` would show something like `88x66`.
423+
- `TITLE`: terminal title via OSC sequences for setting terminal title
424+
- `PROGRAM`: (e.g `fish`, `zsh`, `bash`, `vim`, etc...)
425+
- `ABSOLUTE_PATH`: (e.g `/Users/rapha/Documents/a/rio`)
426+
<!-- - `CANONICAL_PATH`: (e.g `.../Documents/a/rio`, `~/Documents/a`) -->
427+
- `COLUMNS`: current columns
428+
- `LINES`: current lines
429+
- So, for example if you have: `{{COLUMNS}}x{{LINES}}` would show something like `88x66`.
418430
- Perf improvement on text selection [#898](https://github.com/raphamorim/rio/pull/898) by [@marc2332](https://github.com/marc2332).
419431
- Window title is now updated regardless the Navigation Mode.
420432
- Performance: Background and foreground data are only retrieved if is asked (either color automation is enabled or `window.title` contains any request for it).
@@ -432,8 +444,8 @@ fonts.symbol-map = [{ start = "2297", end = "2299", font-family = "Cascadia Code
432444
- On macOS, fixed undocumented cursors (e.g. zoom, resize, help) always appearing to be invalid and falling back to the default cursor.
433445
- Introduce `SwitchCurrentTabToPrev` and `SwitchCurrentTabToNext` actions [#854](https://github.com/raphamorim/rio/pull/854/files) by [@agjini](https://github.com/agjini).
434446
- On X11, Wayland, Windows and macOS, improved scancode conversions for more obscure key codes.
435-
- On macOS, fixed the scancode conversion for audio volume keys.
436-
- On macOS, fixed the scancode conversion for `IntlBackslash`.
447+
- On macOS, fixed the scancode conversion for audio volume keys.
448+
- On macOS, fixed the scancode conversion for `IntlBackslash`.
437449
- Kitty keyboard protocol is now enabled by default.
438450
- Allow `Renderer` to be configured cross-platform by `Platform` property.
439451
- Add `ToggleFullscreen` to configurable actions.
@@ -475,6 +487,7 @@ windows.shell.args = ["-l"]
475487
linux.shell.program = "tmux"
476488
linux.shell.args = ["new-session", "-c", "/var/www"]
477489
```
490+
478491
- Fix: Grey triangle in the titlebar [#778](https://github.com/raphamorim/rio/issues/778)
479492
- Update window title straight away ([#779](https://github.com/raphamorim/rio/pull/779) by [@hunger](https://github.com/hunger))
480493
- Always update the title on windows and MacOS ([#780](https://github.com/raphamorim/rio/pull/780) by [@hunger](https://github.com/hunger))
@@ -483,10 +496,10 @@ linux.shell.args = ["new-session", "-c", "/var/www"]
483496

484497
- Note: The migration from 0.1.x to v0.2.x changed considerably the renderer source code, although it was tested for 3 weeks it's entirely possible that introduced bugs (hopefully not!).
485498
- Performance gains!
486-
- Sugarloaf: Major rewrite of font glyph logic.
487-
- Sugarloaf: Removal of some unnecessary processing on shaping logic.
488-
- Sugarloaf: Rewrite/Change of render architecture, now sugarloaf does not have any reference to column/lines logic.
489-
- *Breaking:* Minimum MacOS version went from El Captain to Big Sur on ARM64 and Catalina on Intel x86.
499+
- Sugarloaf: Major rewrite of font glyph logic.
500+
- Sugarloaf: Removal of some unnecessary processing on shaping logic.
501+
- Sugarloaf: Rewrite/Change of render architecture, now sugarloaf does not have any reference to column/lines logic.
502+
- _Breaking:_ Minimum MacOS version went from El Captain to Big Sur on ARM64 and Catalina on Intel x86.
490503
- Microsoft Windows: [Rio terminal is now available on WinGet packages](https://github.com/microsoft/winget-pkgs/pull/184792).
491504
- Microsoft Windows: [Rio terminal is now available on MINGW packages](https://github.com/msys2/MINGW-packages/pull/22248).
492505
- Microsoft Windows: Rio support on ARM architecture by [@andreban](https://github.com/andreban).
@@ -513,7 +526,7 @@ linux.shell.args = ["new-session", "-c", "/var/www"]
513526
- Add DWMWA_CLOAK support on Microsoft Windows.
514527
- VI Mode now supports search by [@orhun](https://github.com/orhun).
515528
- Use max frame per seconds based on the current monitor refresh rate.
516-
- *breaking* `renderer.max-fps` has been changed to `renderer.target-fps`.
529+
- _breaking_ `renderer.max-fps` has been changed to `renderer.target-fps`.
517530
- Fix background color for underline and beam cursors when using transparent window.
518531
- Fix IME color for underline and beam cursors.
519532
- Add default for Style property on Sugarloaf font.
@@ -568,7 +581,7 @@ linux.shell.args = ["new-session", "-c", "/var/www"]
568581
- Introduce: `renderer.max-fps`.
569582
- Fix: Cursor making text with ligatures hidden.
570583
- Fix: Underline cursor not working.
571-
- Fix: sixel: Text doesn't overwrite sixels [#636](https://github.com/raphamorim/rio/issues/636).
584+
- Fix: sixel: Text doesn't overwrite sixels [#636](https://github.com/raphamorim/rio/issues/636).
572585
- Initial support to Sixel protocol.
573586
- Support to `fonts.emoji`. You can also specify which emoji font you would like to use, by default will be loaded a built-in Twemoji color by Mozilla.
574587

@@ -618,7 +631,7 @@ blinking = false
618631
- Support CSI_t 16 (Report Cell Size in Pixels).
619632
- Support CSI_t 14 (Report Terminal Window Size in Pixels).
620633
- Fix on all the issues regarding whenever the font atlas reaches the limit.
621-
- *breaking change*: collapsed tabs use now `tabs-active-highlight` instead of `tabs-active`.
634+
- _breaking change_: collapsed tabs use now `tabs-active-highlight` instead of `tabs-active`.
622635
- Default font for UI has changed to [DepartureMono](https://departuremono.com/).
623636
- Performance: drop extra texture creation and manipulation.
624637
- Fix on windows: If editor is not found, the app panics [#641](https://github.com/raphamorim/rio/issues/641).
@@ -701,8 +714,8 @@ args = ["-w"]
701714
- Support custom colors on all underlines.
702715
- Support for advaned formatting (squiggly underline?) [#370](https://github.com/raphamorim/rio/issues/370)
703716
- Performance improvements!
704-
- Cache strategy has improved to cover any line that have been previously rendered.
705-
- Render backgrounds and cursors in one pass.
717+
- Cache strategy has improved to cover any line that have been previously rendered.
718+
- Render backgrounds and cursors in one pass.
706719
- Update tokio
707720

708721
## 0.1.5
@@ -783,10 +796,10 @@ opacity = 0.8
783796
```
784797

785798
- Major rewrite on sugarloaf.
786-
- New rendering architecture.
787-
- Sugarloaf now uses same render pass for each render.
788-
- Ignore equal renderers.
789-
- Compute layout updates only if layout is different.
799+
- New rendering architecture.
800+
- Sugarloaf now uses same render pass for each render.
801+
- Ignore equal renderers.
802+
- Compute layout updates only if layout is different.
790803
- `BottomTab` navigation is now default for Linux and Windows.
791804
- Support to font ligatures.
792805
- Support bluetooth access on MacOs.
@@ -825,8 +838,8 @@ opacity = 0.8
825838

826839
## 0.0.37
827840

828-
- *Breaking change:* Reduced font size to `16.0`.
829-
- *Breaking change:* Set `VI mode` trigger with CTRL + SHIFT + SPACE on Windows.
841+
- _Breaking change:_ Reduced font size to `16.0`.
842+
- _Breaking change:_ Set `VI mode` trigger with CTRL + SHIFT + SPACE on Windows.
830843
- Update winit to 0.30.0.
831844
- Update rust version to 1.77.2.
832845
- Initial touch support by [@androw](https://github.com/androw) [#226](https://github.com/raphamorim/rio/pull/226)
@@ -881,6 +894,7 @@ disable-ctlseqs-alt = false
881894
- Introduction of `keyboard.disable-ctlseqs-alt`: Disable ctlseqs with ALT keys. It is useful for example if you would like Rio to replicate Terminal.app, since it does not deal with ctlseqs with ALT keys
882895

883896
- Introduction of new configuration property called `renderer`.
897+
884898
```toml
885899
[renderer]
886900
performance = "High"
@@ -895,6 +909,7 @@ backend = "Automatic"
895909
# DX11: Supported on Windows 7+
896910
# Metal: Supported on macOS/iOS
897911
```
912+
898913
- Fix: update padding top on config change [#378](https://github.com/raphamorim/rio/pull/378) by [@hougesen](https://github.com/hougesen)
899914
- Fixed bug where color automation did not work on Linux because of line ending character.
900915
- Fix: Control + Up/Down don't works as expected on neovim [#371](https://github.com/raphamorim/rio/issues/371)
@@ -1229,8 +1244,8 @@ clickable = false
12291244
```
12301245

12311246
- Performance improvements with Sugarloaf de-duplication of input data.
1232-
- Before: `~253.5µs`.
1233-
- Now: `~51.5µs`.
1247+
- Before: `~253.5µs`.
1248+
- Now: `~51.5µs`.
12341249
- Introduce `navigation.use-current-path` which sets if a tab/breacrumb should be open from the current context path.
12351250
- Fix rendering unicode with 1 width glyphs (fix [#160](https://github.com/raphamorim/rio/issues/160)).
12361251
- Increased max tabs from 9 to 20.
@@ -1275,10 +1290,10 @@ clickable = false
12751290
## 0.0.10
12761291

12771292
- Major refactor of Sugarloaf.
1278-
- Performance improvements around 80-110%.
1279-
- Introduced CachedSugar.
1280-
- Usage of PixelScale.
1281-
- Line-height support.
1293+
- Performance improvements around 80-110%.
1294+
- Introduced CachedSugar.
1295+
- Usage of PixelScale.
1296+
- Line-height support.
12821297
- Open new tab using the current tab directory.
12831298
- Fix some symbols break the horizontal and vertical alignment of lines (ref [#148](https://github.com/raphamorim/rio/issues/148)).
12841299
- Fix font size configuration is confusing (ref [#139](https://github.com/raphamorim/rio/issues/139)).
@@ -1353,6 +1368,7 @@ use-fork = true
13531368
- Breaking changes for configuration file regarding `Style` property.
13541369

13551370
before:
1371+
13561372
```toml
13571373
performance = "High"
13581374
[style]
@@ -1361,6 +1377,7 @@ theme = "lucario"
13611377
```
13621378

13631379
now:
1380+
13641381
```toml
13651382
performance = "High"
13661383
theme = "lucario"

rio-backend/src/crosswords/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2219,6 +2219,15 @@ impl<U: EventListener> Handler for Crosswords<U> {
22192219
}
22202220
}
22212221

2222+
#[inline]
2223+
fn report_version(&mut self) {
2224+
trace!("Reporting terminal version (XTVERSION)");
2225+
let version = env!("CARGO_PKG_VERSION");
2226+
let text = format!("\x1bP>|Rio {version}\x1b\\");
2227+
self.event_proxy
2228+
.send_event(RioEvent::PtyWrite(text), self.window_id);
2229+
}
2230+
22222231
#[inline]
22232232
fn report_keyboard_mode(&mut self) {
22242233
let current_mode = self.keyboard_mode_stack[self.keyboard_mode_idx];

rio-backend/src/performer/handler.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,9 @@ pub trait Handler {
294294
/// DECRPM - report private mode.
295295
fn report_private_mode(&mut self, _mode: PrivateMode) {}
296296

297+
/// XTVERSION - Report terminal version.
298+
fn report_version(&mut self) {}
299+
297300
/// DECSTBM - Set the terminal scrolling region.
298301
fn set_scrolling_region(&mut self, _top: usize, _bottom: Option<usize>) {}
299302

@@ -1104,8 +1107,16 @@ impl<U: Handler, T: Timeout> copa::Perform for Performer<'_, U, T> {
11041107
let mode = next_param_or(0);
11051108
handler.report_private_mode(PrivateMode::new(mode));
11061109
}
1110+
('q', [b'>']) => {
1111+
// XTVERSION (CSI > q) -- Query Terminal Version.
1112+
if next_param_or(0) != 0 {
1113+
csi_unhandled!();
1114+
return;
1115+
}
1116+
handler.report_version();
1117+
}
11071118
('q', [b' ']) => {
1108-
// DECSCUSR (CSI Ps SP q) -- Set Cursor Style.
1119+
// DECSCUSR (CSI SP q) -- Set Cursor Style.
11091120
let cursor_style_id = next_param_or(0);
11101121
let shape = match cursor_style_id {
11111122
0 => None,

0 commit comments

Comments
 (0)