27 Commits

Author SHA1 Message Date
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
ilk
e5411284dd fix(elvish-integration): fix mistakes
fix some missing imports and (shamefully) faulty logic.
2024-05-31 12:20:12 +03:00
Mitchell Hashimoto
66a9b1b99f rename env var 2024-05-27 16:18:51 -07:00
Mitchell Hashimoto
982e4c9570 prettier 2024-05-27 16:16:43 -07:00
ilk
2863d2c148 refactor(shell-integration): refactor to make cases alphabetical
also fix: build errors
also fix: name mismatch (GHOSTTY_FISH_XDG_DIR -> GHOSTTY_INTEGRATION_DIR)
also refactor elvish file to evade unobvious returns
2024-05-27 16:15:13 -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
Mitchell Hashimoto
17e7ff1de3 shell-integration: add README about Elvish 2024-05-27 16:11:08 -07:00
ilk
a1a97913d3 refactor(shell-integration:elvish): refactor to improve readability 2024-05-17 18:11:00 +03:00
ilk
597328432c feat(shell-integration): add integration for Elvish
- contains `.elv` file that implements the core of Elvish integration.
- does not contain routines needed for automatic integration.
- stored in `./elvish/lib/...` in preparation for automatic integration:
  Elvish imports `.../elvish/lib/*.elv`.

checklist:
- no confirmation on close where the cursor is at prompt:
  works, only occasionally doesn't, I'm not yet sure when.
- new terminals start in pwd of previously focused terminal: works
- prompts resize correctly: works
- triple-click while holding `ctrl` selects output of a command:
  works (when mouse is over the output)
- cursor at the prompt is turned into a bar: works
- ghostty:`jump_to_prompt` scrolls through prompts: works
- `opt`-click moves cursor at the prompt: works
- `sudo` preserves ghostty terminfo:
   untested - not sure when this is needed exactly, but did not encounter
   any errors after sudo, either
2024-05-16 20:45:14 +03:00
Mitchell Hashimoto
cbcb4b27bc Merge pull request #1766 from jparise/bash-readme
shell-integration: update Bash integration details
2024-05-14 18:22:16 -04:00
Jon Parise
d5414d50ea shell-integration: update Bash integration details 2024-05-14 15:06:05 -07:00
Jon Parise
11f3400e49 shell-integration: suppress shellcheck issues 2024-05-14 06:57:02 -07:00
Jon Parise
baf5116140 shell-integration: update bash-preexec.sh
This pulls in a fix for `bind -x` bindings unintentionally calling the
preexec hook: https://github.com/rcaloras/bash-preexec/pull/152
2024-05-10 09:39:26 -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
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
Tim Culverhouse
4fac674016 shell-integration: implement "no-cursor" option
Implement a "no-cursor" option for shell integration. This option acts
like "detect" but doesn't set the cursor shape.
2023-11-07 16:31:07 -06:00
Mitchell Hashimoto
0bdd73797e Fix rendering issues with bash shell integration (#301)
* shell-integration/bash: we need to wrap escape sequences in brackets

* nix: install bashInteractive on Linux
2023-08-17 22:42:26 -07:00
Mitchell Hashimoto
9d61212451 Simplify Bash Integration (#299)
* shell-integration: new bash integration that is much simpler

* shell-integration: bash fixes
2023-08-17 21:50:42 -07:00
Mitchell Hashimoto
a058bcbdb0 shell-integration: add bash script (no auto-inject yet) 2023-08-17 13:26:06 -07:00
Kevin Hovsäter
22b8173164 Fix typos 2023-08-08 14:27:34 +02:00
Mitchell Hashimoto
363e911f77 shell-integration/zsh: enable title changes 2023-08-04 11:14:45 -07:00
Mitchell Hashimoto
80e2cd4e78 zsh integration 2023-07-06 17:46:54 -07:00
Mitchell Hashimoto
4cdad44119 zsh files starting 2023-07-06 16:42:01 -07:00
Mitchell Hashimoto
efd7cb35b8 fish: pwd reporting 2023-07-06 16:15:30 -07:00
Mitchell Hashimoto
ad62e3ac1b fish shell integration 2023-07-06 16:10:30 -07:00
Mitchell Hashimoto
848943770a start shell-integration folder, copy into zig-out 2023-07-06 13:26:28 -07:00