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

kitty: add shellIntegration #3759

Merged
merged 1 commit into from May 12, 2023

Conversation

Scrumplex
Copy link
Member

Description

Kitty provides integrations for bash, fish and zsh. The new programs.kitty.shellIntegration options allow the configuration of these integrations.

See https://sw.kovidgoyal.net/kitty/shell-integration for more details

Checklist

  • Change is backwards compatible.

  • Code formatted with ./format.

  • Code tested through nix-shell --pure tests -A run.all.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

  • If this PR adds a new module

    • Added myself as module maintainer. See example.

    • Added myself and the module files to .github/CODEOWNERS.

@Scrumplex Scrumplex requested a review from rycee as a code owner March 12, 2023 10:13
@Scrumplex Scrumplex marked this pull request as draft March 12, 2023 10:19
@Scrumplex Scrumplex marked this pull request as ready for review March 12, 2023 10:35
modules/programs/kitty.nix Outdated Show resolved Hide resolved
modules/programs/kitty.nix Outdated Show resolved Hide resolved
@Scrumplex Scrumplex requested review from ncfavier and removed request for rycee March 12, 2023 10:43
Copy link
Member

@ncfavier ncfavier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit confusing to have enable = true, enable*Integration = true and mode = "enabled". Can we simplify this?

@Scrumplex
Copy link
Member Author

Hmm. What if we get rid of enable and only check if one of the enable*Integration options is true?

@Scrumplex
Copy link
Member Author

Or alternatively, check if mode != "disabled"

@Scrumplex Scrumplex force-pushed the kitty-shell-integration branch 2 times, most recently from e84778d to bd0c528 Compare March 12, 2023 11:00
@ncfavier
Copy link
Member

At startup, kitty detects if the shell you have configured (either system wide or the shell option in kitty.conf) is a supported shell. If so, kitty injects some shell specific code into the shell, to enable shell integration.

If kitty does this automatically, why do we have to do it ourselves?

@Scrumplex
Copy link
Member Author

It is just more robust, especially for more complex workflows:

The automatic shell integration is designed to be minimally intrusive, as such it wont work for sub-shells, terminal multiplexers, containers, etc. For such systems, you should setup manual shell integration by adding some code to your shells startup files to load the shell integration script.

modules/programs/kitty.nix Outdated Show resolved Hide resolved
modules/programs/kitty.nix Outdated Show resolved Hide resolved
@Scrumplex Scrumplex force-pushed the kitty-shell-integration branch 4 times, most recently from 0375173 to 4c86f23 Compare March 13, 2023 11:50
Kitty provides integrations for bash, fish and zsh. The new
programs.kitty.shellIntegration options allow the configuration of
these integrations.

See <https://sw.kovidgoyal.net/kitty/shell-integration> for more details.

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
@erooke
Copy link

erooke commented Mar 25, 2023

It is just more robust, especially for more complex workflows:

The automatic shell integration is designed to be minimally intrusive, as such it wont work for sub-shells, terminal multiplexers, containers, etc. For such systems, you should setup manual shell integration by adding some code to your shells startup files to load the shell integration script.

Also, the way kitty does this is by modifying the bashrc at runtime which it can't do if the bashrc is managed by home manager.

@Scrumplex Scrumplex requested a review from ncfavier May 12, 2023 09:17
@ncfavier ncfavier merged commit a835096 into nix-community:master May 12, 2023
3 checks passed
rasmus-kirk pushed a commit to rasmus-kirk/home-manager that referenced this pull request May 20, 2023
Kitty provides integrations for bash, fish and zsh. The new
programs.kitty.shellIntegration options allow the configuration of
these integrations.

See <https://sw.kovidgoyal.net/kitty/shell-integration> for more details.

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
antholeole pushed a commit to antholeole/home-manager that referenced this pull request May 21, 2023
Kitty provides integrations for bash, fish and zsh. The new
programs.kitty.shellIntegration options allow the configuration of
these integrations.

See <https://sw.kovidgoyal.net/kitty/shell-integration> for more details.

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
sysedwinistrator pushed a commit to sysedwinistrator/home-manager that referenced this pull request May 30, 2023
Kitty provides integrations for bash, fish and zsh. The new
programs.kitty.shellIntegration options allow the configuration of
these integrations.

See <https://sw.kovidgoyal.net/kitty/shell-integration> for more details.

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
aciceri pushed a commit to aciceri/home-manager that referenced this pull request Jun 16, 2023
Kitty provides integrations for bash, fish and zsh. The new
programs.kitty.shellIntegration options allow the configuration of
these integrations.

See <https://sw.kovidgoyal.net/kitty/shell-integration> for more details.

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants