<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ghostty.git/src/shell-integration/fish, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/ghostty.git/'/>
<entry>
<title>shell-integration: append $GHOSTTY_BIN_DIR to $PATH</title>
<updated>2025-10-01T14:42:33+00:00</updated>
<author>
<name>Jon Parise</name>
<email>jon@indelible.org</email>
</author>
<published>2025-10-01T14:42:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/ghostty.git/commit/?id=6f596ee7c353706d0bba4088eb43c31e4dd677b9'/>
<id>6f596ee7c353706d0bba4088eb43c31e4dd677b9</id>
<content type='text'>
For consistency with the termio/Exec.zig implementation, we always
append to the PATH (lowest priority).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For consistency with the termio/Exec.zig implementation, we always
append to the PATH (lowest priority).
</pre>
</div>
</content>
</entry>
<entry>
<title>fix: cleaned up elvish and fish integrations for bin_dir</title>
<updated>2025-10-01T04:26:07+00:00</updated>
<author>
<name>Matthew Hrehirchuk</name>
<email>matthew_hre@outlook.com</email>
</author>
<published>2025-10-01T04:26:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/ghostty.git/commit/?id=9407e0fd0d7bc7243b5eaf04658a591cd77e41a3'/>
<id>9407e0fd0d7bc7243b5eaf04658a591cd77e41a3</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>feat: add GHOSTTY_BIN_DIR to path via shell integration</title>
<updated>2025-09-30T17:26:20+00:00</updated>
<author>
<name>Matthew Hrehirchuk</name>
<email>matthew_hre@outlook.com</email>
</author>
<published>2025-09-30T17:23:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/ghostty.git/commit/?id=4cc663fc6003aa6626d4a9c73f1763b862dc569f'/>
<id>4cc663fc6003aa6626d4a9c73f1763b862dc569f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fix fish shell syntax for ssh-env shell integration</title>
<updated>2025-08-04T10:28:39+00:00</updated>
<author>
<name>Robbie Vanbrabant</name>
<email>robbie.vanbrabant@gmail.com</email>
</author>
<published>2025-08-04T10:28:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/ghostty.git/commit/?id=42e4a95b64c48b051eaaa61c975b07ffafc1edc6'/>
<id>42e4a95b64c48b051eaaa61c975b07ffafc1edc6</id>
<content type='text'>
As discussed here https://github.com/ghostty-org/ghostty/discussions/8021

This fixes invalid fish shell syntax.

As an example, run ghostty like so: `XDG_CONFIG_HOME=/tmp ghostty --shell-integration-features=ssh-env --command="/usr/bin/env fish"`. Setting XDG_CONFIG_HOME to /tmp is just to start from the default config.

Before:

```
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
robbiev@neo ~/s/ghostty (fish-shell-ssh)&gt; ssh git@github.com
env: ‘command’: No such file or directory
robbiev@neo ~/s/ghostty (fish-shell-ssh) [127]&gt;
```

After:

```
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
robbiev@neo ~/s/ghostty (fish-shell-ssh)&gt; ssh git@github.com
PTY allocation request failed on channel 0
Hi robbiev! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
robbiev@neo ~/s/ghostty (fish-shell-ssh) [1]&gt;
```

My understanding of the fix follows.

The script is using `command` to make sure it calls the actual ssh binary and not some intermediate shell function with the same name (`man command` explains).

`env` can be useful for fish compat &lt; 3.1, where [the KEY=value syntax was introduced](https://fishshell.com/docs/current/faq.html#how-do-i-set-or-clear-an-environment-variable). However because `command` is a builtin it doesn't work in this case.

So a simple solution is this, requiring fish &gt;= 3.1

```
TERM="$ssh_term" command ssh $ssh_opts $argv
```

An [alternative](https://serverfault.com/questions/164305/how-can-i-set-environment-variable-for-just-one-command-in-fish-shell) for maximum fish compat could be the following:

```
begin
  set -lx TERM "$ssh_term"
  command ssh $ssh_opts $argv
end
```

According to `man set`, `-l` means local to the block and `-x` means export.

I'm in favour of keeping `command` as it makes the integration more predicable.

The reason I went with the current fix:
- It's easier to understand without knowing fish shell.
- [kat found that fish 3.1 should be widely available](https://github.com/ghostty-org/ghostty/discussions/8021#discussioncomment-13877129).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As discussed here https://github.com/ghostty-org/ghostty/discussions/8021

This fixes invalid fish shell syntax.

As an example, run ghostty like so: `XDG_CONFIG_HOME=/tmp ghostty --shell-integration-features=ssh-env --command="/usr/bin/env fish"`. Setting XDG_CONFIG_HOME to /tmp is just to start from the default config.

Before:

```
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
robbiev@neo ~/s/ghostty (fish-shell-ssh)&gt; ssh git@github.com
env: ‘command’: No such file or directory
robbiev@neo ~/s/ghostty (fish-shell-ssh) [127]&gt;
```

After:

```
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
robbiev@neo ~/s/ghostty (fish-shell-ssh)&gt; ssh git@github.com
PTY allocation request failed on channel 0
Hi robbiev! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
robbiev@neo ~/s/ghostty (fish-shell-ssh) [1]&gt;
```

My understanding of the fix follows.

The script is using `command` to make sure it calls the actual ssh binary and not some intermediate shell function with the same name (`man command` explains).

`env` can be useful for fish compat &lt; 3.1, where [the KEY=value syntax was introduced](https://fishshell.com/docs/current/faq.html#how-do-i-set-or-clear-an-environment-variable). However because `command` is a builtin it doesn't work in this case.

So a simple solution is this, requiring fish &gt;= 3.1

```
TERM="$ssh_term" command ssh $ssh_opts $argv
```

An [alternative](https://serverfault.com/questions/164305/how-can-i-set-environment-variable-for-just-one-command-in-fish-shell) for maximum fish compat could be the following:

```
begin
  set -lx TERM "$ssh_term"
  command ssh $ssh_opts $argv
end
```

According to `man set`, `-l` means local to the block and `-x` means export.

I'm in favour of keeping `command` as it makes the integration more predicable.

The reason I went with the current fix:
- It's easier to understand without knowing fish shell.
- [kat found that fish 3.1 should be widely available](https://github.com/ghostty-org/ghostty/discussions/8021#discussioncomment-13877129).
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove unnecessary stderr redirection in fish integration</title>
<updated>2025-07-19T08:52:55+00:00</updated>
<author>
<name>HuaDeity</name>
<email>hello@huadeity.com</email>
</author>
<published>2025-07-19T08:52:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/ghostty.git/commit/?id=d8c64c05112a8d15fa591e11cb29957f974b44a4'/>
<id>d8c64c05112a8d15fa591e11cb29957f974b44a4</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix shell variable expansion in fish SSH setup</title>
<updated>2025-07-19T08:52:03+00:00</updated>
<author>
<name>HuaDeity</name>
<email>hello@huadeity.com</email>
</author>
<published>2025-07-19T08:52:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/ghostty.git/commit/?id=6769f3c307d3e7ae0a018c7006d05490cf7fc0ab'/>
<id>6769f3c307d3e7ae0a018c7006d05490cf7fc0ab</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>shell-integration.fish: don't use $ssh_terminfo</title>
<updated>2025-07-16T15:34:36+00:00</updated>
<author>
<name>HuaDeity</name>
<email>hello@huadeity.com</email>
</author>
<published>2025-07-16T15:34:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/ghostty.git/commit/?id=2f2f1df6371832b885d281cb9a3e2f5718c699a9'/>
<id>2f2f1df6371832b885d281cb9a3e2f5718c699a9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>shell-integration: use $GHOSTTY_BIN_DIR/ghostty</title>
<updated>2025-07-09T21:25:34+00:00</updated>
<author>
<name>Jon Parise</name>
<email>jon@indelible.org</email>
</author>
<published>2025-07-09T21:25:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/ghostty.git/commit/?id=f5f2a4dd20642d7ca1d3f380349eb83762f1eb7e'/>
<id>f5f2a4dd20642d7ca1d3f380349eb83762f1eb7e</id>
<content type='text'>
Locate our ghostty binary using $GHOSTTY_BIN_DIR rather than searching
the PATH.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Locate our ghostty binary using $GHOSTTY_BIN_DIR rather than searching
the PATH.
</pre>
</div>
</content>
</entry>
<entry>
<title>shell-integration: simplify "ssh target" checks</title>
<updated>2025-07-09T19:59:59+00:00</updated>
<author>
<name>Jon Parise</name>
<email>jon@indelible.org</email>
</author>
<published>2025-07-09T19:59:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/ghostty.git/commit/?id=e522d54d7b715dfd34fd9e8e36cd9d42d1527ef6'/>
<id>e522d54d7b715dfd34fd9e8e36cd9d42d1527ef6</id>
<content type='text'>
This value is always set to a non-empty string, and we only need this
value after we've determined that 'ssh_hostname' is non-empty.

In bash and zsh, we also don't need to check for the 'ghostty' command
before we attempt to add the target to the cache. That command will
safely fail silently if it's not available.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This value is always set to a non-empty string, and we only need this
value after we've determined that 'ssh_hostname' is non-empty.

In bash and zsh, we also don't need to check for the 'ghostty' command
before we attempt to add the target to the cache. That command will
safely fail silently if it's not available.
</pre>
</div>
</content>
</entry>
<entry>
<title>fish: prefer 'command -q' to check for commands</title>
<updated>2025-07-09T18:34:00+00:00</updated>
<author>
<name>Jon Parise</name>
<email>jon@indelible.org</email>
</author>
<published>2025-07-09T18:29:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/ghostty.git/commit/?id=a1cb52dcd35794c61dc7fb583f25284b7b6347d5'/>
<id>a1cb52dcd35794c61dc7fb583f25284b7b6347d5</id>
<content type='text'>
This is a fish built-in 'command' option that's the more idiomatic way
to check for the availability of a command.

https://fishshell.com/docs/current/cmds/command.html
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a fish built-in 'command' option that's the more idiomatic way
to check for the availability of a command.

https://fishshell.com/docs/current/cmds/command.html
</pre>
</div>
</content>
</entry>
</feed>
