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

✨ Remove Rich tags when showing completion text #877

Merged
merged 6 commits into from
Nov 18, 2024

Conversation

svlandeg
Copy link
Member

@svlandeg svlandeg commented Jul 3, 2024

Upon completion, print the help text with Rich if it's available. Fixes #822.

Original behaviour, as reported in #822: hitting TAB TAB shows the autocompletion with literal Rich formatting, e.g.

goodbye -- Say [bold]goodbye[/bold] to the user.

With this PR, the Rich tags are removed:

goodbye -- Say goodbye to the user.

In my experiments, this does not yet actually format the text with the right colors etc. Not sure whether that's due to the shells/OS's I've tried - further input from others using different systems would be appreciated!

Powershell on Windows

  • Shows Rich tags in completion text with master
  • Removes Rich tags in completion text with this PR
  • Shell is able to show Rich formatting in simple script
  • Shows Rich formatting in completion text with this PR

GitBash using zsh shell on Windows

I couldn't yet get this shell to work with Rich formatting - probably because it's an emulated shell.

  • Shows Rich tags in completion text with master
  • Removes Rich tags in completion text with this PR
  • Shell is able to show Rich formatting in simple script
  • Shows Rich formatting in completion text with this PR

@svlandeg svlandeg added feature New feature, enhancement or request p3 labels Jul 3, 2024
@svlandeg svlandeg marked this pull request as ready for review July 3, 2024 10:30
@kinuax
Copy link
Contributor

kinuax commented Jul 4, 2024

PR Review according to #821.

zsh on Linux

  • Shows Rich tags in completion text with master
  • Removes Rich tags in completion text with this PR
  • Shell is able to show Rich formatting in simple script
  • Shows Rich formatting in completion text with this PR

@svlandeg svlandeg changed the title ✨ Remove Rich tags when showing completion text ✨ Remove Rich tags when showing completion text Aug 26, 2024
@tiangolo
Copy link
Member

tiangolo commented Nov 18, 2024

I just updated this branch with master handling the conflicts, but it seems some tests are no longer passing. 😔

Maybe things we merged recently?

It seems it was something that changed with converting Rich output to HTML: #1055

Copy link
Member

@tiangolo tiangolo left a comment

Choose a reason for hiding this comment

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

Nice, thank you! 🙇 🚀

@tiangolo tiangolo merged commit 603f39d into fastapi:master Nov 18, 2024
23 checks passed
@svlandeg svlandeg deleted the feat/zsh branch November 19, 2024 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature, enhancement or request p3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rich markup in Zsh completion help lines
3 participants