20 Commits

Author SHA1 Message Date
multifred
72c672adb7 Fix multiple deprecated names for zig lib/std 2024-07-22 00:07:17 +02:00
Jon Parise
7d7fa46b0c shell-integration: bash must be explicitly enabled
For now, bash integration must be explicitly enabled (by setting
`shell-integration = bash`). Our automatic shell integration requires
bash version 4 or later, and systems like macOS continue to ship bash
version 3 by default. This approach avoids the cost of performing a
runtime version check.
2024-06-03 20:34:29 -04:00
Mitchell Hashimoto
66a9b1b99f rename env var 2024-05-27 16:18:51 -07:00
ilk
7377ca8917 refactor(shell-integration): refactor to make cases alphabetical
also refactors elvish file to evade unobvious returns
and tries to fix some build errors
2024-05-27 16:15:12 -07:00
ilk
1fa830cc73 feat(shell-integration): add automatic integration for Elvish
Fish automatic integration taken as an example.
Just like fish, Elvish checks `XDG_DATA_DIRS` for its modules.
Thus, Fish integration in zig is reused, and integration in
Elvish now removes `GHOSTTY_FISH_XDG_DIR` environment variable
on launch.
2024-05-27 16:15:01 -07:00
Jon Parise
016c58cfe4 shell-integration: handle 'bash -c command'
When the -c option is present, then commands are read from the first
non-option argument command string. Our simple implementation assumes
that if we see at least the '-c' option, a command string was given, and
the shell is always considered to be non-interactive - even if the '-i'
(interactive) option is also given.
2024-05-14 11:01:49 -07:00
Jon Parise
054e01eaaf shell-integration: expand bash HISTFILE value
bash reads HISTFILE at startup to locate its history file, but this is
apparently too early for it to be able to expand home-relative paths. We
now manually expand the full path and add that to the environment.
2024-05-08 07:49:46 -07:00
Mitchell Hashimoto
d64fa6d9db termio: shell integration uses arena 2024-05-07 19:57:26 -07:00
Jon Parise
861edc722f shell-integration: revise ShellIntegration.command comment 2024-05-05 14:03:31 -07:00
Jon Parise
73b3560e62 shell-integration: automatic bash integration
This change adds automatic bash shell detection and integration.

Unlike our other shell integrations, bash doesn't provide a built-in
mechanism for injecting our ghostty.bash script into the new shell
environment.

Instead, we start bash in POSIX mode and use the ENV environment
variable to load our integration script, and the rest of the bash
startup sequence becomes the responsibility of our script to emulate
(along with disabling POSIX mode).
2024-05-05 13:59:52 -07:00
Jon Parise
54f6abf1cf termio: pass full command to shell integration
This will allow the shell integration code to inspect the full command
string rather than just the first component (shell binary).
2024-04-21 09:53:27 -07:00
Jon Parise
5ea99d3626 termio: fix "forced" shell integration
When a shell is forced, we would supply its /-prefixed executable name
to mimic a path location. The rest of the integration detection logic
assumes just a base executable name. Fix the forced names accordingly.

Also add a unit test for this "force shell" behavior.
2024-04-20 11:37:34 -07:00
Marius Svechla
e34b373426 shell-integration: implement no-title option
This adds a new option to the shell integration feature set, `no-title`.
If this option is set, the shell integration will not automatically
update the window title.
2024-04-03 22:00:42 +02:00
Atanas Pepechkov
ee1366a0a8 add sudo wrapper as optional shell integration feature 2024-01-13 18:56:21 +02:00
Mitchell Hashimoto
48f316ebd2 termio: support XDG data dirs greater than 4k for fish shell integration
Fixes #1228
2024-01-05 14:27:12 -08:00
Mitchell Hashimoto
18c852d47c config: switch shell-integration-features 2023-11-07 17:05:09 -08:00
Mitchell Hashimoto
8239f09d9d allow configuring shell integration injection 2023-07-06 18:04:12 -07:00
Mitchell Hashimoto
80e2cd4e78 zsh integration 2023-07-06 17:46:54 -07:00
Mitchell Hashimoto
ad62e3ac1b fish shell integration 2023-07-06 16:10:30 -07:00
Mitchell Hashimoto
ae206b2f89 termio: fish shell integration injection 2023-07-06 14:14:55 -07:00