{"ecosystem":"npm","package":"string-width","version":null,"bugs":[{"id":164,"ecosystem":"npm","package_name":"string-width","affected_version":null,"fixed_version":null,"bug_id":"github:6","title":"Combining characters not supported","description":"For instance, the unicode sequence \"x\\u0300\" renders in a standard Unicode terminal using a single character cell, but string-width counts it as 2. (tested in xfce4-terminal and rxvt-unicode on Debian Jessie)\r\n\r\nThis could be represented as a (non-passing) test:\r\n~~~~\r\nt.is(m('x\\u0300'), 1);\r\n~~~~\r\n\r\n","severity":"medium","status":"fixed","source":"github_issues","source_url":"https://github.com/sindresorhus/string-width/issues/6","labels":["bug","help wanted"],"created_at":"2026-04-19 04:30:33.884435+00:00","updated_at":"2026-04-19 04:30:33.884435+00:00"},{"id":163,"ecosystem":"npm","package_name":"string-width","affected_version":null,"fixed_version":null,"bug_id":"github:42","title":"Handling text variation selector","description":"Hello,\r\n\r\nI realized that some unicode characters output a width of 2 instead of 1 when they have the text variation modifier applied (`\\ufe0e`), e.g.:\r\n\r\n```js\r\n> '\\u21a9\\ufe0e'\r\n'↩︎' // text\r\n> '\\u21a9\\ufe0f'\r\n'↩️' // I cannot paste the emoji for some reason\r\n> stringWidth('\\u21a9\\ufe0f')\r\n2 // Ok\r\n> stringWidth('\\u21a9\\ufe0e')\r\n2 // should be 1\r\n```\r\n\r\nI took a look at the list of unicode characters that accept a variation [here](https://github.com/samhocevar/unicode-emoji/blob/master/emoji-variation-sequences.txt) and it doesn't seem there is a simple rule to follow, some are full-width some are normal so I'm not sure if this can be handled correctly across platforms.\r\n\r\nThis is a display test I used to visually check **some** of the characters:\r\n\r\n```js\r\nconsole.log(`\\u0023\\uFE0E  ; text style;  # (1.1) NUMBER SIGN`)\r\nconsole.log(`\\u0023\\uFE0F  ; emoji style; # (1.1) NUMBER SIGN`)\r\nconsole.log(`\\u002A\\uFE0E  ; text style;  # (1.1) ASTERISK`)\r\nconsole.log(`\\u002A\\uFE0F  ; emoji style; # (1.1) ASTERISK`)\r\nconsole.log(`\\u0030\\uFE0E  ; text style;  # (1.1) DIGIT ZERO`)\r\nconsole.log(`\\u0030\\uFE0F  ; emoji style; # (1.1) DIGIT ZERO`)\r\nconsole.log(`\\u0031\\uFE0E  ; text style;  # (1.1) DIGIT ONE`)\r\nconsole.log(`\\u0031\\uFE0F  ; emoji style; # (1.1) DIGIT ONE`)\r\nconsole.log(`\\u0032\\uFE0E  ; text style;  # (1.1) DIGIT TWO`)\r\nconsole.log(`\\u0032\\uFE0F  ; emoji style; # (1.1) DIGIT TWO`)\r\nconsole.log(`\\u0033\\uFE0E  ; text style;  # (1.1) DIGIT THREE`)\r\nconsole.log(`\\u0033\\uFE0F  ; emoji style; # (1.1) DIGIT THREE`)\r\nconsole.log(`\\u0034\\uFE0E  ; text style;  # (1.1) DIGIT FOUR`)\r\nconsole.log(`\\u0034\\uFE0F  ; emoji style; # (1.1) DIGIT FOUR`)\r\nconsole.log(`\\u0035\\uFE0E  ; text style;  # (1.1) DIGIT FIVE`)\r\nconsole.log(`\\u0035\\uFE0F  ; emoji style; # (1.1) DIGIT FIVE`)\r\nconsole.log(`\\u0036\\uFE0E  ; text style;  # (1.1) DIGIT SIX`)\r\nconsole.log(`\\u0036\\uFE0F  ; emoji style; # (1.1) DIGIT SIX`)\r\nconsole.log(`\\u0037\\uFE0E  ; text style;  # (1.1) DIGIT SEVEN`)\r\nconsole.log(`\\u0037\\uFE0F  ; emoji style; # (1.1) DIGIT SEVEN`)\r\nconsole.log(`\\u0038\\uFE0E  ; text style;  # (1.1) DIGIT EIGHT`)\r\nconsole.log(`\\u0038\\uFE0F  ; emoji style; # (1.1) DIGIT EIGHT`)\r\nconsole.log(`\\u0039\\uFE0E  ; text style;  # (1.1) DIGIT NINE`)\r\nconsole.log(`\\u0039\\uFE0F  ; emoji style; # (1.1) DIGIT NINE`)\r\nconsole.log(`\\u00A9\\uFE0E  ; text style;  # (1.1) COPYRIGHT SIGN`)\r\nconsole.log(`\\u00A9\\uFE0F  ; emoji style; # (1.1) COPYRIGHT SIGN`)\r\nconsole.log(`\\u00AE\\uFE0E  ; text style;  # (1.1) REGISTERED SIGN`)\r\nconsole.log(`\\u00AE\\uFE0F  ; emoji style; # (1.1) REGISTERED SIGN`)\r\nconsole.log(`\\u203C\\uFE0E  ; text style;  # (1.1) DOUBLE EXCLAMATION MARK`)\r\nconsole.log(`\\u203C\\uFE0F  ; emoji style; # (1.1) DOUBLE EXCLAMATION MARK`)\r\nconsole.log(`\\u2049\\uFE0E  ; text style;  # (3.0) EXCLAMATION QUESTION MARK`)\r\nconsole.log(`\\u2049\\uFE0F  ; emoji style; # (3.0) EXCLAMATION QUESTION MARK`)\r\nconsole.log(`\\u2122\\uFE0E  ; text style;  # (1.1) TRADE MARK SIGN`)\r\nconsole.log(`\\u2122\\uFE0F  ; emoji style; # (1.1) TRADE MARK SIGN`)\r\nconsole.log(`\\u2139\\uFE0E  ; text style;  # (3.0) INFORMATION SOURCE`)\r\nconsole.log(`\\u2139\\uFE0F  ; emoji style; # (3.0) INFORMATION SOURCE`)\r\nconsole.log(`\\u2194\\uFE0E  ; text style;  # (1.1) LEFT RIGHT ARROW`)\r\nconsole.log(`\\u2194\\uFE0F  ; emoji style; # (1.1) LEFT RIGHT ARROW`)\r\nconsole.log(`\\u2195\\uFE0E  ; text style;  # (1.1) UP DOWN ARROW`)\r\nconsole.log(`\\u2195\\uFE0F  ; emoji style; # (1.1) UP DOWN ARROW`)\r\nconsole.log(`\\u2196\\uFE0E  ; text style;  # (1.1) NORTH WEST ARROW`)\r\nconsole.log(`\\u2196\\uFE0F  ; emoji style; # (1.1) NORTH WEST ARROW`)\r\nconsole.log(`\\u2197\\uFE0E  ; text style;  # (1.1) NORTH EAST ARROW`)\r\nconsole.log(`\\u2197\\uFE0F  ; emoji style; # (1.1) NORTH EAST ARROW`)\r\nconsole.log(`\\u2198\\uFE0E  ; text style;  # (1.1) SOUTH EAST ARROW`)\r\nconsole.log(`\\u2198\\uFE0F  ; emoji style; # (1.1) SOUTH EAST ARROW`)\r\nconsole.log(`\\u2199\\uFE0E  ; text style;  # (1.1) SOUTH WEST ARROW`)\r\nconsole.log(`\\u2199\\uFE0F  ; emoji style; # (1.1) SOUTH WEST ARROW`)\r\nconsole.log(`\\u21A9\\uFE0E  ; text style;  # (1.1) LEFTWARDS ARROW WITH HOOK`)\r\nconsole.log(`\\u21A9\\uFE0F  ; emoji style; # (1.1) LEFTWARDS ARROW WITH HOOK`)\r\nconsole.log(`\\u21AA\\uFE0E  ; text style;  # (1.1) RIGHTWARDS ARROW WITH HOOK`)\r\nconsole.log(`\\u21AA\\uFE0F  ; emoji style; # (1.1) RIGHTWARDS ARROW WITH HOOK`)\r\nconsole.log(`\\u231A\\uFE0E  ; text style;  # (1.1) WATCH`)\r\nconsole.log(`\\u231A\\uFE0F  ; emoji style; # (1.1) WATCH`)\r\nconsole.log(`\\u231B\\uFE0E  ; text style;  # (1.1) HOURGLASS`)\r\nconsole.log(`\\u231B\\uFE0F  ; emoji style; # (1.1) HOURGLASS`)\r\nconsole.log(`\\u2328\\uFE0E  ; text style;  # (1.1) KEYBOARD`)\r\nconsole.log(`\\u2328\\uFE0F  ; emoji style; # (1.1) KEYBOARD`)\r\nconsole.log(`\\u23CF\\uFE0E  ; text style;  # (4.0) EJECT SYMBOL`)\r\nconsole.log(`\\u23CF\\uFE0F  ; emoji style; # (4.0) EJECT SYMBOL`)\r\nconsole.log(\r\n  `\\u23E9\\uFE0E  ; text style;  # (6.0) BLACK RIGHT-POINTING DOUBLE TRIANGLE`\r\n)\r\nconsole.log(\r\n  `\\u23E9\\uFE0F  ; emoji style; # (6.0) BLACK RIGHT-POINTING DOUBLE TRIANGLE`\r\n)\r\nconsole.log(\r\n  `\\u23EA\\uFE0E  ; text style;  # (6.0) BLACK LEFT-POINTING DOUBLE TRIANGLE`\r\n)\r\nconsole.log(\r\n  `\\u23EA\\uFE0F  ; emoji style; # (6.0) BLACK LEFT-POINTING DOUBLE TRIANGLE`\r\n)\r\nconsole.log(\r\n  `\\u23ED\\uFE0E  ; text style;  # (6.0) BLACK RIGHT-POINTING DOUBLE TRIANGLE WITH `\r\n)\r\nconsole.log(\r\n  `\\u23ED\\uFE0F  ; emoji style; # (6.0) BLACK RIGHT-POINTING DOUBLE TRIANGLE WITH `\r\n)\r\nconsole.log(\r\n  `\\u23EE\\uFE0E  ; text style;  # (6.0) BLACK LEFT-POINTING DOUBLE TRIANGLE WITH `\r\n)\r\nconsole.log(\r\n  `\\u23EE\\uFE0F  ; emoji style; # (6.0) BLACK LEFT-POINTING DOUBLE TRIANGLE WITH `\r\n)\r\nconsole.log(\r\n  `\\u23EF\\uFE0E  ; text style;  # (6.0) BLACK RIGHT-POINTING TRIANGLE WITH DOUBLE `\r\n)\r\nconsole.log(\r\n  `\\u23EF\\uFE0F  ; emoji style; # (6.0) BLACK RIGHT-POINTING TRIANGLE WITH DOUBLE `\r\n)\r\nconsole.log(`\\u23F1\\uFE0E  ; text style;  # (6.0) STOPWATCH`)\r\nconsole.log(`\\u23F1\\uFE0F  ; emoji style; # (6.0) STOPWATCH`)\r\nconsole.log(`\\u23F2\\uFE0E  ; text style;  # (6.0) TIMER CLOCK`)\r\nconsole.log(`\\u23F2\\uFE0F  ; emoji style; # (6.0) TIMER CLOCK`)\r\nconsole.log(`\\u23F3\\uFE0E  ; text style;  # (6.0) HOURGLASS WITH FLOWING SAND`)\r\nconsole.log(`\\u23F3\\uFE0F  ; emoji style; # (6.0) HOURGLASS WITH FLOWING SAND`)\r\nconsole.log(`\\u23F8\\uFE0E  ; text style;  # (7.0) DOUBLE VERTICAL BAR`)\r\nconsole.log(`\\u23F8\\uFE0F  ; emoji style; # (7.0) DOUBLE VERTICAL BAR`)\r\nconsole.log(`\\u23F9\\uFE0E  ; text style;  # (7.0) BLACK SQUARE FOR STOP`)\r\nconsole.log(`\\u23F9\\uFE0F  ; emoji style; # (7.0) BLACK SQUARE FOR STOP`)\r\nconsole.log(`\\u23FA\\uFE0E  ; text style;  # (7.0) BLACK CIRCLE FOR RECORD`)\r\nconsole.log(`\\u23FA\\uFE0F  ; emoji style; # (7.0) BLACK CIRCLE FOR RECORD`)\r\nconsole.log(\r\n  `\\u24C2\\uFE0E  ; text style;  # (1.1) CIRCLED LATIN CAPITAL LETTER M`\r\n)\r\nconsole.log(\r\n  `\\u24C2\\uFE0F  ; emoji style; # (1.1) CIRCLED LATIN CAPITAL LETTER M`\r\n)\r\nconsole.log(`\\u25AA\\uFE0E  ; text style;  # (1.1) BLACK SMALL SQUARE`)\r\nconsole.log(`\\u25AA\\uFE0F  ; emoji style; # (1.1) BLACK SMALL SQUARE`)\r\nconsole.log(`\\u25AB\\uFE0E  ; text style;  # (1.1) WHITE SMALL SQUARE`)\r\nconsole.log(`\\u25AB\\uFE0F  ; emoji style; # (1.1) WHITE SMALL SQUARE`)\r\nconsole.log(\r\n  `\\u25B6\\uFE0E  ; text style;  # (1.1) BLACK RIGHT-POINTING TRIANGLE`\r\n)\r\nconsole.log(\r\n  `\\u25B6\\uFE0F  ; emoji style; # (1.1) BLACK RIGHT-POINTING TRIANGLE`\r\n)\r\nconsole.log(`\\u25C0\\uFE0E  ; text style;  # (1.1) BLACK LEFT-POINTING TRIANGLE`)\r\nconsole.log(`\\u25C0\\uFE0F  ; emoji style; # (1.1) BLACK LEFT-POINTING TRIANGLE`)\r\nconsole.log(`\\u25FB\\uFE0E  ; text style;  # (3.2) WHITE MEDIUM SQUARE`)\r\nconsole.log(`\\u25FB\\uFE0F  ; emoji style; # (3.2) WHITE MEDIUM SQUARE`)\r\nconsole.log(`\\u25FC\\uFE0E  ; text style;  # (3.2) BLACK MEDIUM SQUARE`)\r\nconsole.log(`\\u25FC\\uFE0F  ; emoji style; # (3.2) BLACK MEDIUM SQUARE`)\r\nconsole.log(`\\u25FD\\uFE0E  ; text style;  # (3.2) WHITE MEDIUM SMALL SQUARE`)\r\nconsole.log(`\\u25FD\\uFE0F  ; emoji style; # (3.2) WHITE MEDIUM SMALL SQUARE`)\r\nconsole.log(`\\u25FE\\uFE0E  ; text style;  # (3.2) BLACK MEDIUM SMALL SQUARE`)\r\nconsole.log(`\\u25FE\\uFE0F  ; emoji style; # (3.2) BLACK MEDIUM SMALL SQUARE`)\r\nconsole.log(`\\u2600\\uFE0E  ; text style;  # (1.1) BLACK SUN WITH RAYS`)\r\nconsole.log(`\\u2600\\uFE0F  ; emoji style; # (1.1) BLACK SUN WITH RAYS`)\r\nconsole.log(`\\u2601\\uFE0E  ; text style;  # (1.1) CLOUD`)\r\nconsole.log(`\\u2601\\uFE0F  ; emoji style; # (1.1) CLOUD`)\r\nconsole.log(`\\u2602\\uFE0E  ; text style;  # (1.1) UMBRELLA`)\r\nconsole.log(`\\u2602\\uFE0F  ; emoji style; # (1.1) UMBRELLA`)\r\nconsole.log(`\\u2603\\uFE0E  ; text style;  # (1.1) SNOWMAN`)\r\nconsole.log(`\\u2603\\uFE0F  ; emoji style; # (1.1) SNOWMAN`)\r\nconsole.log(`\\u2604\\uFE0E  ; text style;  # (1.1) COMET`)\r\nconsole.log(`\\u2604\\uFE0F  ; emoji style; # (1.1) COMET`)\r\nconsole.log(`\\u260E\\uFE0E  ; text style;  # (1.1) BLACK TELEPHONE`)\r\nconsole.log(`\\u260E\\uFE0F  ; emoji style; # (1.1) BLACK TELEPHONE`)\r\nconsole.log(`\\u2611\\uFE0E  ; text style;  # (1.1) BALLOT BOX WITH CHECK`)\r\nconsole.log(`\\u2611\\uFE0F  ; emoji style; # (1.1) BALLOT BOX WITH CHECK`)\r\nconsole.log(`\\u2614\\uFE0E  ; text style;  # (4.0) UMBRELLA WITH RAIN DROPS`)\r\nconsole.log(`\\u2614\\uFE0F  ; emoji style; # (4.0) UMBRELLA WITH RAIN DROPS`)\r\nconsole.log(`\\u2615\\uFE0E  ; text style;  # (4.0) HOT BEVERAGE`)\r\nconsole.log(`\\u2615\\uFE0F  ; emoji style; # (4.0) HOT BEVERAGE`)\r\nconsole.log(`\\u2618\\uFE0E  ; text style;  # (4.1) SHAMROCK`)\r\nconsole.log(`\\u2618\\uFE0F  ; emoji style; # (4.1) SHAMROCK`)\r\nconsole.log(`\\u261D\\uFE0E  ; text style;  # (1.1) WHITE UP POINTING INDEX`)\r\nconsole.log(`\\u261D\\uFE0F  ; emoji style; # (1.1) WHITE UP POINTING INDEX`)\r\nconsole.log(`\\u2620\\uFE0E  ; text style;  # (1.1) SKULL AND CROSSBONES`)\r\nconsole.log(`\\u2620\\uFE0F  ; emoji style; # (1.1) SKULL AND CROSSBONES`)\r\nconsole.log(`\\u2622\\uFE0E  ; text style;  # (1.1) RADIOACTIVE SIGN`)\r\nconsole.log(`\\u2622\\uFE0F  ; emoji style; # (1.1) RADIOACTIVE SIGN`)\r\nconsole.log(`\\u2623\\uFE0E  ; text style;  # (1.1) BIOHAZARD SIGN`)\r\nconsole.log(`\\u2623\\uFE0F  ; emoji style; # (1.1) BIOHAZARD ","severity":"medium","status":"fixed","source":"github_issues","source_url":"https://github.com/sindresorhus/string-width/issues/42","labels":["bug","help wanted"],"created_at":"2026-04-19 04:30:33.883316+00:00","updated_at":"2026-04-19 04:30:33.883316+00:00"}],"total":2,"_cache":"hit"}