2093 Commits

Author SHA1 Message Date
Thorsten Ball
147d5b0f3e gtk: fix arrow-up stealing focus
This fixes #253 -- with essentially a single line! Just took me a while
to find out where to add this line.

Turns out we already solved this problem for `<Tab>` so now we do the
same thing for `<Up>`: we tell the `GtkApplication` we handled the event
so it doesn't propagate any further.
2023-08-09 20:11:03 +02:00
Mitchell Hashimoto
2c140b5a22 Merge pull request #257 from mitchellh/pckeys
bind sequences for PC style function keys from xterm
2023-08-08 16:45:36 -07:00
Mitchell Hashimoto
7ac61469c9 bind sequences for PC style function keys from xterm
Fixes #256

This makes a whole lot more sequences work, such as `ctrl+left`,
`ctrl+shift+f1`, etc. We were just missing these completely.

This also found an issue where if you split a sequence across two
`write()` syscalls, then `/bin/sh` (I didn't test other shells)
treats it as two literals rather than parsing as a single sequence.
Great.
2023-08-08 16:43:27 -07:00
Mitchell Hashimoto
591bd3c719 Merge pull request #252 from mitchellh/caps
keyboard bindings should never take caps/num lock into account
2023-08-08 11:01:33 -07:00
Mitchell Hashimoto
bfe6cfeb1a keyboard bindings should never take caps/num lock into account 2023-08-08 10:58:05 -07:00
Mitchell Hashimoto
a295d1e872 revert back to nix 22.11, see comment 2023-08-08 10:32:49 -07:00
Mitchell Hashimoto
0fafed7b21 Merge pull request #251 from mitchellh/resources-dir
gtk: app icon
2023-08-08 09:59:07 -07:00
Mitchell Hashimoto
42735bd0e0 apprt/embedded: new resources dir api 2023-08-08 09:55:23 -07:00
Mitchell Hashimoto
e93a6eb2e4 apprt/gtk: set icon name 2023-08-08 09:44:11 -07:00
Mitchell Hashimoto
6b45d931c3 plumb through the resources dir to termio 2023-08-08 09:29:38 -07:00
Mitchell Hashimoto
bd7cc4b71d core: App looks up resources dir on startup 2023-08-08 09:21:52 -07:00
Mitchell Hashimoto
4e9dcf6b62 os: add resourcesDir function to find app resource dir 2023-08-08 09:17:14 -07:00
Mitchell Hashimoto
c0f5c0ef41 termio/exec: poll() needs a negative timeout to block 🤡 2023-08-08 09:14:08 -07:00
Mitchell Hashimoto
c2137360f4 update nix to 23.05 (#250)
* update nix to 23.05

* nix: do not install gdb on macos
2023-08-08 09:01:47 -07:00
Mitchell Hashimoto
8f69a9c55d Merge pull request #249 from mitchellh/fix-typos
Fix typos
2023-08-08 08:09:43 -07:00
Kevin Hovsäter
22b8173164 Fix typos 2023-08-08 14:27:34 +02:00
Mitchell Hashimoto
aff64d9951 Merge pull request #247 from mitchellh/gtk-single-instance
GTK single instance, fix UB in termio read thread termination
2023-08-07 21:43:08 -07:00
Mitchell Hashimoto
6d32d74996 apprt/gtk: remove useless calls 2023-08-07 21:15:42 -07:00
Mitchell Hashimoto
e2e876bfa1 termio/exec: make sure that process is dead before killing read thread 2023-08-07 21:13:33 -07:00
Mitchell Hashimoto
b5bb3b3739 termio/exec: if read thread gets 0 bytes then break the tight loop 2023-08-07 21:10:11 -07:00
Mitchell Hashimoto
816cad07b9 termio/exec: set pty fd to non-blocking, try to read as long as possible 2023-08-07 20:55:01 -07:00
Mitchell Hashimoto
f40a90e7aa termio: use a pipe to notify the reader thread to quit
Simultaneously reading and closing a fd is UB. We need to ensure that we
quit, then close.
2023-08-07 20:41:34 -07:00
Mitchell Hashimoto
2e98d43a58 apprt/glfw: launch window on startup 2023-08-07 19:28:48 -07:00
Mitchell Hashimoto
60a36ca5cc apprt/gtk: enable single instance mode 2023-08-07 19:26:57 -07:00
Mitchell Hashimoto
22296b377a Revert "Merge pull request #244 from mitchellh/alt-as-esc"
This reverts commit c139279d479682c17f63d9b57c2d56608d09d16a, reversing
changes made to 4ed21047a734d7c586debe0026e3b6ea90ed1622.

We do want to do this but this broke bindings.
2023-08-07 17:06:40 -07:00
Mitchell Hashimoto
23935c3563 change sentinel value for resources dir, its different on Linux 2023-08-07 16:16:44 -07:00
Mitchell Hashimoto
ebbf42eec6 search for resources dir relative to executing binary on Linux (#245)
* search for resources dir relative to executing binary on Linux

From Andrew in #241:

This works in all 3 of the possible scenarios I can think of on Linux:
 * `zig build` with default prefix into `zig-out`
 * `zig build -p ~/local` (my choice when compiling from source)
 * ghostty packaged for a linux distribution into /usr/bin and /share

* update README
2023-08-07 16:08:27 -07:00
Mitchell Hashimoto
c139279d47 Merge pull request #244 from mitchellh/alt-as-esc
Make Ghostty aware of left/right modifier keys
2023-08-07 16:01:31 -07:00
Mitchell Hashimoto
274f934e88 key: fix wrong comment 2023-08-07 15:39:08 -07:00
Mitchell Hashimoto
32eb226fa3 non-macos doesn't support directional bindings 2023-08-07 14:52:20 -07:00
Mitchell Hashimoto
47bed51177 bindings can contain directional modifiers: left_shift+a 2023-08-07 14:43:44 -07:00
Mitchell Hashimoto
eca5955e65 apprt/gtk: new input mods format 2023-08-07 14:35:52 -07:00
Mitchell Hashimoto
67cbabd605 make keyboard modifiers left/right-aware throughout core 2023-08-07 14:33:56 -07:00
Mitchell Hashimoto
4ed21047a7 build: update flatpak to point to correct zig version 2023-08-07 11:15:29 -07:00
Mitchell Hashimoto
456d6c6c84 Merge pull request #240 from mitchellh/linux-build
Fix some Linux build issues
2023-08-07 11:10:15 -07:00
Mitchell Hashimoto
f631e38b99 Merge pull request #239 from mitchellh/mrn/specify-main-nib-file
macOS: explicitly name the NSMainNibFile in plist
2023-08-07 10:58:37 -07:00
Mitchell Hashimoto
c7865f0aad nix: remove unused libs 2023-08-07 10:55:56 -07:00
Mitchell Hashimoto
a348adf26b build: dynamic link first (mode_first) 2023-08-07 10:49:50 -07:00
Thorsten Ball
39055ebf40 macOS: explicitly name the NSMainNibFile in plist
According to [this answer][0] here and [this blogpost][1], if the
`NSMainNibFile` is not specified in the `*.plist` file, then
`NSApplicationMain` will look through the bundle to get the first nib
file it finds.

I like the explicitness of naming it and it probably also saves a
miniscule amount of CPU/IO when we can skip finding the file.

[0]: https://stackoverflow.com/questions/42886400/how-does-nsapplicationmain-find-the-main-nib-file
[1]: https://jameshfisher.com/2017/03/20/how-is-mainmenu-xib-loaded/
2023-08-07 19:48:04 +02:00
Mitchell Hashimoto
d356d5ea38 build: add libxml2/libbuid for fontconfig dynamic link for CI 2023-08-07 10:33:00 -07:00
Mitchell Hashimoto
68cd53e82d build: always add /usr/lib/{triple} to search path for Linux
This is a common location for dynamic libraries. We already searched it
for Flatpak but we need to do this more generally.
2023-08-07 10:20:20 -07:00
Mitchell Hashimoto
b28c7a5557 Merge pull request #238 from mitchellh/ignore-restore-mode
CSI r for top/bot margin must have no intermediates
2023-08-07 09:54:46 -07:00
Mitchell Hashimoto
5e100a3b6b CSI r for top/bot margin must have no intermediates
We were incorrectly interpreting the restore mode CSI (`ESC [ ? r`) as
set top and bottom margin. We need to verify that there are no
intermediates.
2023-08-07 09:45:44 -07:00
Mitchell Hashimoto
24ef5d1b1c tests for insert mode (4) 2023-08-07 08:07:14 -07:00
Mitchell Hashimoto
1ec395fa4f Merge pull request #235 from mitchellh/insert-mode
terminal: implement insert mode (mode = 4)
2023-08-07 07:45:50 -07:00
Mitchell Hashimoto
5c6d3c7df2 terminal: implement insert mode (mode = 4) 2023-08-07 07:44:13 -07:00
Mitchell Hashimoto
407fc3da24 Merge pull request #233 from mitchellh/mrn/flatpak-fix-icons
flatpak: install icon files to `/apps` path
2023-08-06 10:00:26 -07:00
Mitchell Hashimoto
f77b114423 Merge pull request #232 from mitchellh/cursor-vis
renderer: hide cursor is state explicit asks for invisible cursor
2023-08-06 09:59:47 -07:00
Mitchell Hashimoto
85e32f9a15 renderer: hide cursor is state explicit asks for invisible cursor
This was a regression. The previous logic would always show the cursor
if we were using a non-blinking cursor. But, if the terminal state is
explicitly requesting an invisible cursor (mode 25) then we need to hide
the cursor.
2023-08-06 09:55:13 -07:00
Thorsten Ball
89227a1aac flatpak: install icon files to /apps path
I couldn't get icons to work for the flatpak version, so I looked at the
reference here: https://docs.flatpak.org/en/latest/freedesktop-quick-reference.html

That says the path format is `share/icons/hicolor/<resolution>/apps/<icon>`.

That also matches what I have on my Ubuntu machines: icons are, for
example, located in these two locations:

- `/usr/share/icons/hicolor/128x128/apps`
- `~/.local/share/icons/hicolor/128x128/apps`

Note the `/apps`.
2023-08-06 18:54:45 +02:00