本文整理匯總了TypeScript中terminal-kit.terminal.inputField方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript terminal.inputField方法的具體用法?TypeScript terminal.inputField怎麽用?TypeScript terminal.inputField使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類terminal-kit.terminal
的用法示例。
在下文中一共展示了terminal.inputField方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
() => {
const input = term.inputField({
history: history1,
autoComplete: autoComplete1,
autoCompleteMenu: true
}).promise;
term.green("\nYour name is '%s'\n", input);
};
示例2: terminate
// 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);
});
function terminate() {
term.grabInput(false);
setTimeout(() => {}, 100);
}
term.bold.cyan("Type anything on the keyboard...\n");
term.green("Hit CTRL-C to quit.\n\n");
term.grabInput({ mouse: "button" });
term.on("key", (name: string, matches: any[], data: any) => {
console.log("'key' event:", name);
if (name === "CTRL_C") {