Commit d865ff8f authored by antoor's avatar antoor

Add completion features

增加自动补全功能
parent f0873342
......@@ -196,7 +196,19 @@ class Terminal {
greetings: banner,
name: `terminal_${this.hash}`,
prompt: this.parsePrompt(infoUser),
exit: false
exit: false,
completion: (term, value, callback) => {
callback(
this.isWin ? [
'dir', 'whoami', 'net', 'ipconfig', 'netstat', 'cls',
'wscript', 'nslookup', 'copy', 'del', 'ren', 'md', 'type'
] : [
'cd', 'ls', 'find', 'cp', 'mv', 'rm', 'ps', 'kill',
'file', 'tar', 'cat', 'chown', 'chmod', 'pwd', 'history',
'whoami', 'ifconfig', 'clear'
]
)
}
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment