Firebase-tools: Functions shell, cursor position wrong when using backspace

Created on 21 Sep 2017  路  9Comments  路  Source: firebase/firebase-tools

Something odd going on with cursor position and deleting characters when using the new functions shell. It's off by one, deleting one character further to the left than you would anticipate. Running fish shell, not sure if that has anything to do with it.

Version info

$ firebase --version                                                                                                                                                  
3.12.0

Steps to reproduce

  1. Start functions shell
  2. Enter one character
  3. Delete it with backspace. It works fine.
  4. Enter two characters.
  5. Delete one with backspace, the last character is removed but the first one is moved one step to the left and the cursor is in the wrong place.

Expected behavior

Being able to delete characters with regular cursor position.

Most helpful comment

Yeah, it's still likely unicode. I've seen things before where unicode characters like emoji, since they take up two literal characters, can throw off terminals that aren't built to handle them well. Since the emoji is more of a flourish than a necessity, we'll probably just remove it in favor of always using the fallback firebase prompt.

All 9 comments

I'm seeing the exact same (cursor misplaced + same delete issues as @oscar-b) on intellij terminal
firebase-tools v3.12.0
firebase-functions v0.6.3
nodeJs v6.11.1

Do you see the fire emoji prompt? Wondering if it's a unicode issue.

@mbleigh I'm not seeing any fire emojis, and seeing strange box icons:
(And notice the cursor over the last character like @oscar-b was saying)

screen shot 2017-09-22 at 23 02 18

Then I can confirm that it's almost certainly a unicode issue. We'll see about fixing it soon 馃槃

VSCode gives me the 馃敟 alright!
(Would love to hear/medium.com about firebase'rs IDE setup/plugins, seems like ye'r all on VSCode in there?)

screen shot 2017-09-22 at 23 13 29

Yup, I'm a pretty big fan of VSCode. Switched over maybe a year ago and haven't looked back! Not everyone uses the same thing though, I've seen everything from Atom to Vim to IntelliJ on the Firebase team.

kapture 2017-09-23 at 0 22 59

Hey @mbleigh! I see the 馃敟 prompt correctly, see gif. This is in regular macOS Sierra terminal with fish.

Yeah, it's still likely unicode. I've seen things before where unicode characters like emoji, since they take up two literal characters, can throw off terminals that aren't built to handle them well. Since the emoji is more of a flourish than a necessity, we'll probably just remove it in favor of always using the fallback firebase prompt.

-flourish flag? 馃槄

Was this page helpful?
0 / 5 - 0 ratings