Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
  • iterm2 iterm2
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 2,658
    • Issues 2,658
    • List
    • Boards
    • Service Desk
    • Milestones
    • Requirements
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • George Nachman
  • iterm2iterm2
  • Issues
  • #7239
Closed
Open
Issue created Oct 18, 2018 by Weeble Wilson@clockworksaint

Console confused by emojis with variant selector 0xFE0F

  • iTerm2 version: Build 3.2.4beta3
  • OS version: macOS High Sierra
  • plist file: com.googlecode.iterm2.plist

Emojis composed with the "variant selector 16" character code appear as the wrong width and confuse the backspace motion.

Detailed steps to reproduce the problem:

  1. Start a bash session.
  2. Enter: heart='\xe2\x9d\xa4\xef\xb8\x8f'
  3. Enter: printf "$heart$heart$heart\n"

What happened: The heart emojis appeared overlapped. image

What should have happened: The heart emojis should not overlap. image

Alternatively:

  1. Start a bash session.
  2. Press ctrl+cmd+space to bring up the system emoji selector.
  3. Select the red heart emoji.
  4. Press backspace.
  5. Press backspace again.

What happened: At step 3, the double-width heart emoji appeared, but the cursor only advanced one character cell, so it was still overlapping the emoji. At step 4, the heart emoji appeared to have been deleted. (But actually only the zero-width variant selector was deleted from the command buffer.) At step 5, the cursor moved left again, unexpectedly.

What should have happened: At step 3, the cursor should have advanced two cells. At steps 4 and 5, either: on the first keystroke the cursor should have moved left one cell and the emoji heart been replaced by a non-emoji heart symbol, and on the second keystroke the cursor should have moved left another cell and the heart been deleted entirely; OR on the first keystroke the cursor should have moved left two cells and the heart disappeared entirely, and the second keystroke should have had no effect other than bash ringing the bell.

I'm not 100% sure this is just an iTerm2 bug. I think bash/readline is treating the heart symbol and the emoji variant selector as two separate typed/deletable characters, which is a little surprising. Nevertheless, iterm2 could be handling this more gracefully.

Assignee
Assign to
Time tracking