Skip to content

feat(shell): add xonsh integration#1069

Open
EzraCerpac wants to merge 3 commits into
alexpasmantier:mainfrom
EzraCerpac:xonsh-support
Open

feat(shell): add xonsh integration#1069
EzraCerpac wants to merge 3 commits into
alexpasmantier:mainfrom
EzraCerpac:xonsh-support

Conversation

@EzraCerpac

@EzraCerpac EzraCerpac commented May 15, 2026

Copy link
Copy Markdown

PR Description

Adds xonsh shell integration for tv init xonsh.

This includes:

  • xonsh shell detection and CLI enum support
  • prompt-toolkit keybindings for smart autocomplete and shell history
  • xonsh setup docs for direct init and saved integration files
  • tests for init output, unsupported standalone completions, keybindings, metadata, and script rendering

Standalone clap completions remain unsupported for xonsh, matching nu/cmd-style unsupported behavior.

Parts of this PR were generated with AI assistance. I reviewed the changes and checked them locally.

Checklist

  • my commits and PR title follow the conventional commits format
  • if this is a new feature, I have added tests to consolidate the feature and prevent regressions
  • I have added a reasonable amount of documentation to the code where appropriate

Copilot AI review requested due to automatic review settings May 15, 2026 16:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds xonsh support to Television’s shell integration (tv init xonsh) by extending shell detection/CLI enums, introducing a new xonsh integration script using prompt-toolkit keybindings, updating documentation, and adding test coverage for init/completions behavior.

Changes:

  • Add xonsh as a supported shell target for tv init, including keybinding rendering and metadata handling.
  • Introduce a new xonsh integration script (completion.xsh) with prompt-toolkit keybindings for smart autocomplete and shell history.
  • Update user/developer docs and add CLI tests for xonsh init output and “unsupported completions” behavior.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/cli/special.rs Adds CLI-level tests covering tv init xonsh output markers and tv completions xonsh unsupported behavior.
television/utils/shell/completion.xsh New xonsh prompt-toolkit integration script implementing smart autocomplete + shell history bindings.
television/utils/shell.rs Extends shell enum/mapping/template rendering to include xonsh, plus unit tests for keybindings/metadata/script rendering.
television/cli/args.rs Adds Xonsh to the CLI shell ValueEnum so tv init xonsh / tv completions xonsh parse correctly.
docs/user-guide/04-shell-integration.md Documents how to enable xonsh integration via direct init and via a saved integration file.
docs/developers/shell-integration-local.md Updates local development instructions to include xonsh.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread television/utils/shell/completion.xsh Outdated
@cfbender

Copy link
Copy Markdown

tested and working for me on tv 0.15.6 and xonsh 0.23.6!

thanks!

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.

3 participants