ueli icon indicating copy to clipboard operation
ueli copied to clipboard

Impossible to input any command after commandline tool (BUG)

Open sergejfedorov opened this issue 1 year ago • 3 comments

I need to create shortcut to open FirefoxPortable.exe with parameters -no-deelevate, standart

FirefoxPortable.exe -no-deelevate

I tried to create shortcut with "commandline tool", because "File path" type is not work. This is an image

But after launching Firefox when i launch uelie console again its impossible to input any command (here is no any text cursor, also known as a caret) until i close Firefox This is an image

sergejfedorov avatar Nov 05 '22 04:11 sergejfedorov

What happens if you type in this for the command:

Start "" "C:\Programs\Firefox\FirefoxPortable.exe" -no-deelevate

oliverschwendener avatar Nov 05 '22 09:11 oliverschwendener

What happens if you type in this for the command:

Start "" "C:\Programs\Firefox\FirefoxPortable.exe" -no-deelevate

I checked - still same problem with "commandline tool"

But when i made *.bat file contains start command and launch with "File path" tool - its continue to work

sergejfedorov avatar Nov 06 '22 01:11 sergejfedorov

This is bug happens due to the fact that the shortcuts-plugin waits for the promise of the command-exector to resolve. The used exec() call waits for the started process to end or die until it's callback is triggered and until then blocks the Ui.

I played around with this a bit and it helps with the shortcuts issue.

export function spawnCommand(command: string): Promise<void> {
    return new Promise((resolve, reject) => {
        const spawnOptions: SpawnOptions = {
            detached: true,
            shell: true,
            stdio: "ignore"
        }
        spawn(command, spawnOptions).on("error", reject).on("spawn", resolve);
    });
}
new ShortcutsSearchPlugin(
            config.shortcutOptions,
            urlExecutor,
            filePathExecutor,
            filePathLocationExecutor,
            spawnCommand,
        ),

schmic avatar Mar 09 '23 11:03 schmic