Skip to content

Use of --posix for bash integration causes unwanted side effects #5349

@dcolascione

Description

@dcolascione

Describe the bug

Kitty's addition of --posix to bash command line for integration injection makes the injection non-transparent and can break user scripts. In particular, --posix causes bash to enable the inherit_errexit shell option. inherit_errexit remains enabled even after kitty.bash resets the posix shell option.

inherit_errexit being unexpectedly enabled can break sourced shell functions in subtle and hard-to-guess ways.

To Reproduce
Steps to reproduce the behavior:

  1. Launch bash in kitty with integration enabled
  2. Run shopt -p inherit_errexit
  3. Observe that inherit_errexit is enabled
  4. Run the same command in xterm and observe that inherit_errexit is disabled

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions