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

Add readline ignore sequences to PS1 #1041

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

yunzheng
Copy link
Member

This adds RL_PROMPT_START_IGNORE and RL_PROMPT_END_IGNORE sequences to PS1.

Fixes #1003

This adds RL_PROMPT_START_IGNORE and RL_PROMPT_END_IGNORE sequences to PS1.

Fixes #1003
@yunzheng
Copy link
Member Author

And tab completion still works :)

Copy link

codecov bot commented Feb 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.24%. Comparing base (fc54fdc) to head (24c2e09).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1041   +/-   ##
=======================================
  Coverage   78.24%   78.24%           
=======================================
  Files         336      336           
  Lines       29673    29673           
=======================================
  Hits        23217    23217           
  Misses       6456     6456           
Flag Coverage Δ
unittests 78.24% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Schamper
Copy link
Member

Can you add a unit test for tab completion 😉

@JSCU-CNI
Copy link
Contributor

I think we can test tab completion in a similar fashion as pypy does: pypy/pypy@2c7ab72#diff-29b9d7f8caca9a166907d2bb7ead6c15a939e9dba3ca8b9d76ba0af97729cb18

@yunzheng
Copy link
Member Author

Added test using pexpect, thanks for the tip :)

I also found an issue when creating the test, the output of ls does not honor NO_COLOR=1:

image

notice that localtime and network is colored in NO_COLOR=1 mode.

@yunzheng
Copy link
Member Author

Skipping the test on Windows due to missing pexpect. I'm not sure why the test fails on PyPy. Will look into this another time.

- First of all it doesn't seem to work at all in GitHub CI (timeout reached with no output).
- On local tests, the PyPy's REPL output contains too much ANSI escape codes. Not colors, but like turning off cursor, or bracketed pasting codes which messes with the simplicity of the current matching code.
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.

target-shell prompt not rendering ANSI color codes
3 participants