Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux console #1063

Open
NeonGC opened this issue Nov 2, 2021 · 0 comments
Open

Linux console #1063

NeonGC opened this issue Nov 2, 2021 · 0 comments

Comments

@NeonGC
Copy link

NeonGC commented Nov 2, 2021

Version

v10.19.0

Platform

Linux 45-159-188-235 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

https://github.com/sullof/inquirer-command-prompt

What steps will reproduce the bug?

import` inquirer from "inquirer";
import inquirerCommandPrompt from 'inquirer-command-prompt';

inquirer.registerPrompt('command', inquirerCommandPrompt)
let arr=['users','rooms','help','user','handlers','handlers name'];

async function runPrompt() {
    return inquirer.prompt([
        {
            type: 'command',
            name: 'cmd',
            message: '>',
            short: true,
            validate: val => {
                if (val.endsWith(" ")) val = val.slice(0,-1);
                return val && arr[val]
                    ? true
                    : 'If you don\'t know the available commands, type help for help'
            },
            // optional
            autoCompletion: arr,
            context: 0
        }
    ]).then(answers => {
        if (answers.cmd.endsWith(" ")) answers.cmd = answers.cmd.slice(0,-1);
        const command = arr[answers.cmd];

        console.log(command+" runned!");

        if (answers.cmd !== 'quit' || answers.cmd !== 'exit' || answers.cmd !== "stop" || answers.cmd !== "rs") {
            return runPrompt();
        }
    }).catch(err => {
        console.log(err.stack);
        runPrompt();
    })
}

runPrompt();

How often does it reproduce? Is there a required condition?

Press tab. After that, no command works without restarting the application.

What is the expected behavior?

All commands should appear

What do you see instead?

image

Additional information

bandicam.2021-11-02.14-42-25-009.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant