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

readline: tabs not accepted is a bug or a feature? #1756

Closed
Trott opened this issue May 21, 2015 · 4 comments
Closed

readline: tabs not accepted is a bug or a feature? #1756

Trott opened this issue May 21, 2015 · 4 comments
Labels
question Issues that look for answers. readline Issues and PRs related to the built-in readline module.

Comments

@Trott
Copy link
Member

Trott commented May 21, 2015

Inspired by #264, I was taking a look at https://github.com/nodejs/io.js/blob/2b1c01c2cc203dd6131c3fc6238cf62a2e697f63/lib/readline.js#L347-L349:

  //BUG: Problem when adding tabs with following content.
  //     Perhaps the bug is in _refreshLine(). Not sure.
  //     A hack would be to insert spaces instead of literal '\t'.

The issue (I think!) is this: If createInterface() is supplied with a completer option, that function is used for tab completion. If not completer function is supplied, then a no-op function is used. Either way, tabs are intercepted and the user cannot enter them.

I've updated the code so that if a completer function is supplied, you get tab completion but otherwise you can enter tab characters.

Before I submit a pull request, though, I'm wondering: Is this actually a bug? Or is it a feature that tab characters are not permitted in Interface.prototype.question()? Is the bug fix really just to mention it in the docs? (Maybe even that's overkill? It presumably isn't worth mentioning that you can't enter a line feed either...)

@brendanashworth brendanashworth added the readline Issues and PRs related to the built-in readline module. label May 21, 2015
@brendanashworth
Copy link
Contributor

bug feature

@brendanashworth
Copy link
Contributor

Looks like a bug to me. A pull request would be great! 😄

@Trott
Copy link
Member Author

Trott commented May 22, 2015

OK, pull request submitted. #1761

@brendanashworth brendanashworth added the question Issues that look for answers. label May 22, 2015
@brendanashworth
Copy link
Contributor

I think discussion will continue on the PR, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Issues that look for answers. readline Issues and PRs related to the built-in readline module.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants