javascript - What does u001b[1Gu001b[2K> mean? - Stack Overflow

I'm running through some javascript code and during testing I received this sequence: u001b[1Gu0

I'm running through some javascript code and during testing I received this sequence: \u001b[1G\u001b[2K> . The entire line was actual: tests\\repl\u001b[1G\u001b[2K> tests\\replTest.js, expected: tests\replTest.js

What does this mean?

I'm running through some javascript code and during testing I received this sequence: \u001b[1G\u001b[2K> . The entire line was actual: tests\\repl\u001b[1G\u001b[2K> tests\\replTest.js, expected: tests\replTest.js

What does this mean?

Share Improve this question edited Apr 4, 2020 at 22:36 franklinsijo 18.3k4 gold badges50 silver badges66 bronze badges asked Jul 31, 2018 at 12:57 AlexAlex 1711 gold badge3 silver badges15 bronze badges 2
  • Those look a lot like ANSI escape codes (in addition to Pointy's ment below, which I took for granted was obvious). – msanford Commented Jul 31, 2018 at 13:01
  • \uXXXX is a hex literal. Look up 001B in a Unicode chart. – Pointy Commented Jul 31, 2018 at 13:01
Add a ment  | 

1 Answer 1

Reset to default 10

Those are unparsed ANSI control codes.

  • \u001b[1G is a "Cursor Horizontal Absolute" code. The 1 means it tries to move the cursor to the first character of the line.
  • \u001b[2K is a "Erase in Line" code. The 2 makes it mean "Erase the entire line".

It looks like a Unicode escaped dump of the input to a console where someone started typing tests\repl, then erased the whole line and instead wrote > tests\replTest.js. Could also be the redirect of the console to a file.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742387510a4434353.html

相关推荐

  • javascript - What does u001b[1Gu001b[2K> mean? - Stack Overflow

    I'm running through some javascript code and during testing I received this sequence: u001b[1Gu0

    4小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信