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

Line disappears when pressing backspace multiple times after a space #152

Open
k4u5h1k opened this issue Mar 25, 2021 · 2 comments
Open

Comments

@k4u5h1k
Copy link

k4u5h1k commented Mar 25, 2021

Do I have a solution?

Yes

Details

Setting self.prompt to a single whitespace
self.prompt = ' '

instead of empty string
self.prompt = ''

in line 1859 of rshell/main.py
fixes the issue completely on OSX

@jamesquilty
Copy link

jamesquilty commented Jul 22, 2022

Thanks for this, that single-character addition does indeed fix the "disappearing prompt" problem that's been troubling me! I note that an artefact of this is that there are now two spaces after the prompt: prompt>␣␣. A quick hack that fixes this is to remove the trailing space from line 1863 and adding it to line 1866 in the current HEAD revision on master appears to fix both problems:

     def set_prompt(self):
         if self.stdin == sys.stdin:
-            prompt = PROMPT_COLOR + cur_dir + END_COLOR + '> '
+            prompt = PROMPT_COLOR + cur_dir + END_COLOR + '>'
             if FAKE_INPUT_PROMPT:
                 print(prompt, end='')
-                self.prompt = ''
+                self.prompt = ' '
             else:
                 self.prompt = prompt
         else:

Edit: PR #153 has the same fix for this 🤔

@k4u5h1k
Copy link
Author

k4u5h1k commented Jul 22, 2022

Yep thats my PR :)

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

No branches or pull requests

2 participants