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

Paste and tabs #114

Open
tsandall opened this issue Jan 8, 2019 · 2 comments
Open

Paste and tabs #114

tsandall opened this issue Jan 8, 2019 · 2 comments

Comments

@tsandall
Copy link

tsandall commented Jan 8, 2019

This is more of a question than a bug or feature request.

I've noticed my tab completion function is called when users paste text into a REPL built on top of liner. I'm wondering if anyone else has run into this. The problem is that the tab completion function returns a candidate which breaks the input.

It looks like some terminals support bracketed paste mode which allows programs to have different behaviour between regular input and paste. I could imagine using this disable tab completion during paste operations.

/ref open-policy-agent/opa#962

@peterh
Copy link
Owner

peterh commented Oct 20, 2019

Interesting suggestion. I was not aware of bracketed paste mode.

I'm not quite sure what to do with bracketed paste mode. Certainly tabs should not be allowed as literal characters in a paste if the user cannot type a literal tab. But should liner eat the tabs silently instead of treating them as completion tokens? I'm not sure. The existence of bracketed paste mode suggests that most people would prefer tabs to be eaten silently. I'd be intrigued to see how invasive a pull request might be.

@tsandall
Copy link
Author

But should liner eat the tabs silently instead of treating them as completion tokens? I'm not sure.

I think so. IOW, while a bracketed paste is being performed, no tab completion would occur from tabs in the input. When the bracketed paste is ended (by the escape code on that page), liner would return the full pasted input.

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