-
Notifications
You must be signed in to change notification settings - Fork 314
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
Tab completion breaks paste #254
Comments
This is an issue with readline and libedit (the libraries used to get user input by almost every command line thing ever, including PsySH) and I don't know that there's a way to fix it other than disabling tab completion :( http://superuser.com/questions/926028/completion-when-pasting-bash-command-beginning-with-tabs |
You could try to disable autocompletion when on a line which only contains tab characters; it is apparently possible with the Python readline bindings at least. Or simple replace tabs with spaces. Or detect the number of characters buffered but not transmitted to readline yet, and guess whether it's a paster based on that. |
As far as I can tell, it's not possible with the PHP readline bindings. The tab characters seem to trigger tab completion immediately, before I have access to them on the readline buffer :-/ |
It actually looks like the results returned here are from a bunch of psysh Matchers - the T_OPEN_TAG is a legitimate hasMatched for (for example) This isn't a case of readline being difficult. If it was, you would be able to set |
I made a pull request to fix this. |
Oh! I forgot to update this diff. This is fixed as of v0.8.11 (the readline way) if you use readline (not libedit) and a reasonably modern terminal app. Enable https://github.com/bobthecow/psysh/releases/tag/v0.8.11 |
Cool! I'll close the PR in that case. Perhaps it is a good idea to close this issue as well, to prevent future confusion :) I am curious why it's readline-only though, I'll dig around a little after lunch. |
When I paste code with two or more tabs to psysh, I get the same behavior that @tgr mentioned in the issue description (see below). I'm running v0.8.17 and I have If I try to paste the code below (middle line indented with two tabs) into the shell:
I get:
If I set
|
Can you paste the output of |
I have |
Yeah. It’s because you’ve got |
Oh, |
Just for the record, the new(ish) |
Pasting this:
(middle line indented with two tabs) into the shell (Psy Shell v0.6.0-dev (PHP 5.5.9-1ubuntu4.11 — cli)) gives
Somehow it should detect that the content is being pasted and ignore tabs.
For longer text, sometimes pasting is interrupted by the "Display... " line and the rest of the pasted input does not appear at all.
The text was updated successfully, but these errors were encountered: