Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

explicit ghostty support in termsdesc.c #2833

Closed
dankamongmen opened this issue Jan 9, 2025 · 16 comments
Closed

explicit ghostty support in termsdesc.c #2833

dankamongmen opened this issue Jan 9, 2025 · 16 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Milestone

Comments

@dankamongmen
Copy link
Owner

we'll probably want an entry for ghostty by @mitchellh et al. let's get the latest built with the latest zig (i'm trying to package zig for debian right now, see https://lists.debian.org/debian-devel/2025/01/msg00098.html) and see what manner of thing we have here.

@dankamongmen dankamongmen added documentation Improvements or additions to documentation enhancement New feature or request labels Jan 9, 2025
@dankamongmen dankamongmen added this to the 3.1.0 milestone Jan 9, 2025
@dankamongmen dankamongmen self-assigned this Jan 9, 2025
@dankamongmen
Copy link
Owner Author

hope you're not on fire, @mitchellh

@mitchellh
Copy link

Thanks. My family is presently safe. A lot of friends are impacted though and it’s just overall a tragedy.

Regarding this issue, let me know if there’s any help you need from me to smooth the process. Or if there’s anything extremely stupid I did I should correct, it’s still early innings and can get that in without burdening society with mistakes.

@dankamongmen
Copy link
Owner Author

from everything i've seen ghostty has moved immediately to the front of the line. once i've got it packaged in debian, i'll be using it more often (kitty remains my mainline for the time being, with foot on wayland, but i'm rarely in wayland). glad to hear you're not in danger. i hope 340 main street is likewise safe; i ate several delicious sandwiches there back in 2015, and later got unexpectedly laid at the Gjelina. LA >> SF forever

hack on!

dankamongmen added a commit that referenced this issue Jan 10, 2025
@dankamongmen
Copy link
Owner Author

alright, after code updates pulled into ghostty this morning, i finally have a working one!

Image

a very nice initial performance on notcurses-info. looks like we're detecting most stuff, wonderful. let's check whether it's doing quadrants/sextants/octants itself, or relying on the font...

@dankamongmen
Copy link
Owner Author

Box.zig suggests quadrants and sextants from a quick visual inspection. doesn't look like we have octants yet.

@dankamongmen
Copy link
Owner Author

we're generating some unimplemented OSCs, some ignoring CSI 22/23 with extra parameters, and a few other things, probably all fine but let's investigate them:

info(grid): loaded OpenGL 4.6
info(io_exec): found Ghostty resources dir: /home/dank/src/ghostty/zig-out/share/ghostty
info(io_exec): shell integration automatically injected shell=termio.shell_integration.Shell.bash
warning(gtk): unimplemented action=apprt.action.Action.Key.cell_size
info(io_exec): started subcommand path=/bin/sh pid=3458017
info(io_exec): subcommand cgroup=-
info(grid): reallocating GPU buffer old=0 new=8
info(grid): reallocating GPU buffer old=8 new=20
info(grid): reallocating GPU buffer old=20 new=38
warning(stream): unimplemented OSC callback: terminal.osc.Command{ .end_of_command = terminal.osc.Command.Command__struct_97744{ .exit_code = 0 } }
warning(stream): unimplemented OSC command: end_of_command
info(grid): reallocating GPU buffer old=38 new=255
info(io_handler): BELL
info(io_handler): BELL
info(grid): reallocating GPU buffer old=255 new=390
warning(io_handler): unimplemented device attributes req: terminal.ansi.DeviceAttributeReq.tertiary
warning(stream): ignoring unimplemented CSI S with intermediates: ?
warning(stream): ignoring unimplemented CSI S with intermediates: ?
warning(stream): ignoring unimplemented CSI S with intermediates: ?
warning(stream): ignoring unimplemented CSI S with intermediates: ?
info(font_codepoint_resolver): found codepoint 0x1F946 in fallback face=Symbola
info(page_list): adjusting page capacity=terminal.page.Capacity{ .cols = 90, .rows = 513, .styles = 256, .hyperlink_bytes = 192, .grapheme_bytes = 8192, .string_bytes = 2048 }
info(page_list): adjusting page capacity=terminal.page.Capacity{ .cols = 90, .rows = 513, .styles = 512, .hyperlink_bytes = 192, .grapheme_bytes = 8192, .string_bytes = 2048 }
info(page_list): adjusting page capacity=terminal.page.Capacity{ .cols = 90, .rows = 513, .styles = 1024, .hyperlink_bytes = 192, .grapheme_bytes = 8192, .string_bytes = 2048 }
warning(stream): unimplemented OSC callback: terminal.osc.Command{ .end_of_command = terminal.osc.Command.Command__struct_97744{ .exit_code = 0 } }
warning(stream): unimplemented OSC command: end_of_command
info(font_codepoint_resolver): found codepoint 0x1FBF0 in fallback face=Cascadia Code Regular
info(grid): reallocating GPU buffer old=390 new=1353
info(font_codepoint_resolver): found codepoint 0x1FBC1 in fallback face=IBM 3270
info(grid): reallocating GPU buffer old=1353 new=2037
info(io_handler): BELL
info(io_handler): BELL
info(io_handler): BELL
warning(stream): unimplemented OSC callback: terminal.osc.Command{ .end_of_command = terminal.osc.Command.Command__struct_97744{ .exit_code = 130 } }
warning(stream): unimplemented OSC command: end_of_command
warning(stream): unimplemented OSC callback: terminal.osc.Command{ .end_of_command = terminal.osc.Command.Command__struct_97744{ .exit_code = 0 } }
warning(stream): unimplemented OSC command: end_of_command
info(grid): reallocating GPU buffer old=2037 new=3063
warning(stream): unimplemented OSC callback: terminal.osc.Command{ .end_of_command = terminal.osc.Command.Command__struct_97744{ .exit_code = 0 } }
warning(stream): unimplemented OSC command: end_of_command
info(io_handler): BELL
warning(stream): ignoring unimplemented CSI 22/23 t
warning(stream): ignoring CSI 22/23 t with extra parameters: ESC [  { 22, 1 } t
info(terminal_dcs): unknown DCS hook: terminal.Parser.Action.DCS{ .intermediates = {  }, .params = {  }, .final = 122 }
warning(stream): unknown CSI m with intermediate: 37
info(stream): OSC 1 (change icon) received and ignored icon=Box.zig
warning(stream): unimplemented OSC command: change_window_icon
info(grid): reallocating GPU buffer old=3063 new=6911
warning(stream): unknown CSI m with intermediate: 63

@dankamongmen
Copy link
Owner Author

looks like ghostty prefers TERM=xterm-ghostty

@dankamongmen
Copy link
Owner Author

good response to XTVERSION: ghostty 1.0.2-main+5cb2fa6f

@dankamongmen
Copy link
Owner Author

yeah sexblitter and quadblitter in keller both look great, plot looks great throughout notcurses-demo. whiteout looks perfect. some bleed on the right of mojibake. some weird underbleed in xray. some strange color interaction in zoo -- look at the right minibox (the one with the empty checkboxen). overall a bit slower than i'd like, but nothing unacceptable in peacetime. notcurses-demo output on 97x57 geometry with 11x24px cells on a 1368x1067 canvas:

             runtime│ frames│output(B)│    FPS│%r│%a│%w│TheoFPS║
══╤════════╤════════╪═══════╪═════════╪═══════╪══╪══╪══╪═══════╣
 1│   intro│   3.39s│    455│  19.64Mi│  134.3│ 1│ 0│15│ 762.56║
 2│    xray│  15.51s│    126│ 411.38Mi│    8.1│ 0│ 0│71│  11.38║
 3│   eagle│   2.58s│    376│   8.85Mi│  145.5│ 2│ 0│ 6│  1.61K║
 4│   trans│  11.12s│   6947│  24.67Mi│  624.8│ 7│ 2│ 6│  3.75K║
 5│uniblock│  14.07s│   1190│   1.47Mi│   84.6│ 1│ 0│ 0│  4.45K║
 6│  normal│   6.21s│    630│   7.27Mi│  101.4│ 1│ 0│ 2│  2.07K║
 7│  chunli│   5.54s│    477│   1.47Mi│   86.0│ 1│ 0│ 0│  3.50K║
 8│ highcon│   2.00s│   5428│ 967.00Ki│ 2712.9│31│13│ 4│  5.40K║
 9│  dragon│   2.42s│    209│  92.12Ki│   86.5│ 1│ 0│ 0│  3.80K║
10│mojibake│  16.36s│   1832│   8.95Mi│  112.0│ 1│ 0│ 1│  3.38K║
11│     box│   3.48s│    100│  16.71Mi│   28.8│ 0│ 0│11│ 234.38║
12│  keller│  14.71s│   1129│  19.04Mi│   76.8│ 1│ 0│ 3│  1.47K║
13│   yield│  16.84s│     79│ 567.70Mi│    4.7│ 0│ 0│91│   5.10║
14│whiteout│   5.00s│  12680│   8.10Mi│ 2535.4│31│ 9│ 6│  5.36K║
15│  jungle│   5.00s│    599│   1.33Mi│  119.8│ 1│ 0│ 1│  3.70K║
16│    grid│   3.57s│    768│ 123.49Mi│  215.2│ 2│ 0│91│ 227.99║
17│ animate│   4.99s│   3334│   3.07Mi│  667.5│ 8│ 2│ 1│  4.93K║
18│    reel│   5.00s│    396│   9.92Mi│   79.2│ 1│ 0│ 4│  1.37K║
19│    view│  17.87s│    990│ 254.38Mi│   55.4│ 0│ 0│37│ 142.95║
20│   luigi│   1.73s│    260│   1.58Mi│  150.0│ 2│ 0│ 1│  3.22K║
21│ sliders│   5.20s│    748│ 813.93Ki│  143.7│ 1│ 0│ 0│  4.80K║
22│ fission│   5.54s│   4328│   2.17Mi│  780.8│10│ 2│ 1│  5.18K║
23│  qrcode│ 13.47µs│      0│     0.00│    0.0│ 0│ 0│ 0│   0.00║
24│     zoo│  13.41s│   1608│   2.23Mi│  119.9│ 1│ 0│ 0│  4.05K║
25│   outro│   9.54s│    833│  31.92Mi│   87.3│ 1│ 0│ 7│ 925.44║
══╧════════╧════════╪═══════╪═════════╪═══════╧══╧══╧══╧═══════╝
             191.09s│  45522│   1.49Gi│

45556 renders, 6.03s (79.85µs min, 132.46µs avg, 1.76ms max)
45556 rasters, 1.82s (19.84µs min, 39.92µs avg, 155.12µs max)
45556 writes, 41.06s (16.67µs min, 901.21µs avg, 200.29ms max)
1.49GiB (99B min, 34.33KiB avg, 7.19MiB max) 3 inputs Ghpa: 0
0 failed renders, 0 failed rasters, 0 refreshes, 0 input errors
RGB emits:elides: def 21171:446079 fg 6072334:5815395 bg 7442293:7641052
Cell emits:elides: 15528748:481714471 (96.88%) 95.47% 48.92% 50.66%
Bmap emits:elides: 1373:1444 (51.26%) 1.23GiB (82.39%) SuM: 4339 (9.52%)

@dankamongmen
Copy link
Owner Author

note that we're properly using kitty protocol, as indicated in the notcurses-info output

@dankamongmen
Copy link
Owner Author

either way, we're done here for now. welcome to the family ghostty!

groovy ghost

@dankamongmen
Copy link
Owner Author

@mitchellh 's code looks pretty clean; if you're not planning on adding font-independent octants (see Unicode 16) in the immediate future, i might take a stab at doing so. holla at your boy!

@mitchellh
Copy link

@mitchellh 's code looks pretty clean; if you're not planning on adding font-independent octants (see Unicode 16) in the immediate future, i might take a stab at doing so. holla at your boy!

We plan on it but not sure if anyone is working on it right now. Pretty easy to add via src/font/sprite. We even generate a bitmap for unit tests to detect pixel changes so you can't fuck up anything else (or, positively verify your new stuff is good).

@dankamongmen
Copy link
Owner Author

We plan on it but not sure if anyone is working on it right now. Pretty easy to add via src/font/sprite. We even generate a bitmap for unit tests to detect pixel changes so you can't fuck up anything else (or, positively verify your new stuff is good).

awesome, i'll try to get this done this week. btw i just uploaded zig0.13 to debian's NEW queue, which will allow me to go ahead and start on packaging ghostty for debian. not sure if it'll make trixie, but we'll see.

@mitchellh
Copy link

Awesome. See this: https://github.com/ghostty-org/ghostty/blob/main/PACKAGING.md

If anything is bullshit in that let me know and I'll fix it up, but so far other packagers have had success.

@dankamongmen
Copy link
Owner Author

dankamongmen commented Jan 21, 2025

yep, i've seen it. i've currently got an MR out on salsa to add minisign support to uscan, which required touching perl =[.

i'm using -Doptimize=ReleaseFast. i'm not using the fetch-zig-cache.sh business nor zig build --fetch; that shit won't fly.

stop trying to make fetch happen

things look reasonable:

[schwarzgerat](0) $ dpkg-deb -c ghostty_1.0.1-1_amd64.deb | grep -v ^d
-rwxr-xr-x root/root  34268776 2025-01-21 13:55 ./usr/bin/ghostty
-rw-r--r-- root/root     19004 2025-01-21 13:55 ./usr/share/bash-completion/completions/ghostty.bash
-rw-r--r-- root/root       212 2025-01-21 13:55 ./usr/share/doc/ghostty/changelog.Debian.gz
-rw-r--r-- root/root    111680 2025-01-21 13:55 ./usr/share/doc/ghostty/ghostty.1.html
-rw-r--r-- root/root     29285 2025-01-21 13:55 ./usr/share/doc/ghostty/ghostty.1.md.gz
-rw-r--r-- root/root    119725 2025-01-21 13:55 ./usr/share/doc/ghostty/ghostty.5.html
-rw-r--r-- root/root     30692 2025-01-21 13:55 ./usr/share/doc/ghostty/ghostty.5.md.gz
-rw-r--r-- root/root     16610 2025-01-21 13:55 ./usr/share/fish/vendor_completions.d/ghostty.fish
-rw-r--r-- root/root    464853 2024-12-31 15:47 ./usr/share/icons/hicolor/1024x1024/apps/com.mitchellh.ghostty.png
-rw-r--r-- root/root     15177 2024-12-31 15:47 ./usr/share/icons/hicolor/128x128/apps/com.mitchellh.ghostty.png
-rw-r--r-- root/root     68177 2024-12-31 15:47 ./usr/share/icons/hicolor/128x128@2/apps/com.mitchellh.ghostty.png
-rw-r--r-- root/root       666 2024-12-31 15:47 ./usr/share/icons/hicolor/16x16/apps/com.mitchellh.ghostty.png
-rw-r--r-- root/root      1563 2024-12-31 15:47 ./usr/share/icons/hicolor/16x16@2/apps/com.mitchellh.ghostty.png
-rw-r--r-- root/root     68189 2024-12-31 15:47 ./usr/share/icons/hicolor/256x256/apps/com.mitchellh.ghostty.png
-rw-r--r-- root/root    221047 2024-12-31 15:47 ./usr/share/icons/hicolor/256x256@2/apps/com.mitchellh.ghostty.png
-rw-r--r-- root/root      1562 2024-12-31 15:47 ./usr/share/icons/hicolor/32x32/apps/com.mitchellh.ghostty.png
-rw-r--r-- root/root      4485 2024-12-31 15:47 ./usr/share/icons/hicolor/32x32@2/apps/com.mitchellh.ghostty.png
-rw-r--r-- root/root    221047 2024-12-31 15:47 ./usr/share/icons/hicolor/512x512/apps/com.mitchellh.ghostty.png
-rw-r--r-- root/root     29470 2025-01-21 13:55 ./usr/share/man/man1/ghostty.1.gz
-rw-r--r-- root/root     31035 2025-01-21 13:55 ./usr/share/man/man5/ghostty.5.gz
-rw-r--r-- root/root        54 2025-01-21 13:55 ./usr/share/nvim/site/ftdetect/ghostty.vim
-rw-r--r-- root/root       398 2025-01-21 13:55 ./usr/share/nvim/site/ftplugin/ghostty.vim
-rw-r--r-- root/root      3604 2025-01-21 13:55 ./usr/share/nvim/site/syntax/ghostty.vim
-rw-r--r-- root/root      3842 2025-01-21 13:55 ./usr/share/terminfo/x/xterm-ghostty
-rw-r--r-- root/root      8083 2025-01-21 13:55 ./usr/share/zsh/site-functions/_ghostty
lrwxrwxrwx root/root         0 2025-01-21 13:55 ./usr/share/terminfo/g/ghostty -> ../x/xterm-ghostty
[schwarzgerat](0) $ 

if anyone's interested, this can be pulled from

deb http://dsscaw.com/repos/apt/debian unstable main
deb-src http://dsscaw.com/repos/apt/debian unstable main
[schwarzgerat](0) $ apt show ghostty
Package: ghostty
Version: 1.0.1-1
Priority: optional
Section: x11
Maintainer: nick black <[email protected]>
Installed-Size: 35.8 MB
Depends: libadwaita-1-0 (>= 1.5~beta), libc6 (>= 2.38), libglib2.0-0t64 (>= 2.42.0), libgtk-4-1 (>= 4.3.1), libx11-6
Homepage: https://ghostty.org/
Download-Size: 16.6 MB
APT-Manual-Installed: yes
APT-Sources: http://dsscaw.com/repos/apt/debian unstable/main amd64 Packages
Description: Platform-native terminal emulator
 Ghostty is a fast, feature-rich, and cross-platform terminal emulator that
 uses platform-native UI and GPU acceleration.

[schwarzgerat](0) $ 

hack on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants