mirror of
https://github.com/wavetermdev/inshellisense.git
synced 2026-08-05 13:43:30 -07:00
fix: add new exit pathways '^D, exit, logout' (#2)
Signed-off-by: Chapman Pendery <cpendery@vt.edu>
This commit is contained in:
@@ -34,7 +34,7 @@ export const action = async (options: RootCommandOptions) => {
|
||||
while (options.duration === "session" || !executed) {
|
||||
const commandToExecute = await render(startingCommand);
|
||||
|
||||
if (commandToExecute == null) {
|
||||
if (commandToExecute == null || commandToExecute.trim().toLowerCase() == "exit" || commandToExecute.trim().toLowerCase() == "logout") {
|
||||
result = { code: 0 };
|
||||
break;
|
||||
}
|
||||
|
||||
+5
-1
@@ -30,7 +30,11 @@ function UI({ startingCommand }: { startingCommand: string }) {
|
||||
}
|
||||
}, []);
|
||||
|
||||
useInput((_, key) => {
|
||||
useInput((input, key) => {
|
||||
if (key.ctrl && input.toLowerCase() == "d") {
|
||||
uiResult = undefined;
|
||||
exit();
|
||||
}
|
||||
if (key.return) {
|
||||
setIsExiting(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user