* Normally cursor movement in windows is relative to the console screen buffer,
* e.g. the application is allowed to overwrite the 'history'. This is very
* inconvenient, it makes absolute cursor movement pretty useless. There is
* also the concept of 'client rect' which is defined by the actual size of
* the console window and the scroll position of the screen buffer, but it's
* very volatile because it changes when the user scrolls.
1条答案
按热度按时间gcxthw6b1#
从描述来看,您似乎在谈论
ansi.js
,它(如accepted answer中的ANSI escape sequences aren't printed to stdout on Windows所述)依赖于libuv
等库。该库实现了中等数量的转义序列。但是参考source-code for ansi.js,它使用escape[S来实现向上滚动特性。
libuv
不处理该转义序列。libuv
中的注解解释了原因:在curses应用程序中,这类事情是通过将右下角的字符写入倒数第二列,然后使用insert-character将其放置到位来完成的。但是
ansi.js
和libuv
都没有实现这一点。