當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript terminal.moveTo方法代碼示例

本文整理匯總了TypeScript中terminal-kit.terminal.moveTo方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript terminal.moveTo方法的具體用法?TypeScript terminal.moveTo怎麽用?TypeScript terminal.moveTo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在terminal-kit.terminal的用法示例。


在下文中一共展示了terminal.moveTo方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: term

// printf() style formatting everywhere:
// this will output 'My name is Jack, I'm 32.' in green
term.green("My name is %s, I'm %d.\n", "Jack", 32);

// Since v0.16.x, style markup are supported as a shorthand.
// Those two lines produce the same result.
term("My name is ")
  .red("Jack")(" and I'm ")
  .green("32\n");
term("My name is ^rJack^ and I'm ^g32\n");

// Width and height of the terminal
term("The terminal size is %dx%d", term.width, term.height);

// Move the cursor at the upper-left corner
term.moveTo(1, 1);

// We can always pass additional arguments that will be displayed...
term.moveTo(1, 1, "Upper-left corner");

// ... and formated
term.moveTo(1, 1, "My name is %s, I'm %d.\n", "Jack", 32);

// ... or even combined with other styles
term.moveTo.cyan(1, 1, "My name is %s, I'm %d.\n", "Jack", 32);

// Get some user input
term.magenta("Enter your name: ");
term.inputField((error: any, input: any) => {
  term.green("\nYour name is '%s'\n", input);
});
開發者ID:csrakowski,項目名稱:DefinitelyTyped,代碼行數:31,代碼來源:terminal-kit-tests.ts


注:本文中的terminal-kit.terminal.moveTo方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。