junegunn / fzf

:cherry_blossom: A command-line fuzzy finder
https://junegunn.github.io/fzf/
MIT License
62.31k stars 2.35k forks source link

FZF to search in winget store and it closes previous fzf window #3739

Open nahid6970 opened 3 months ago

nahid6970 commented 3 months ago

Checklist

Output of fzf --version

0.49.0 (62963dc)

OS

Shell

Problem / Steps to reproduce

hello guys thnx for this tool and really appreciate it. i have used this tool with a python script to install apps from winget it works great but the issue is when i click it it opens the install window where it should open in a new window and the fzf screen should stay there

here is the python script

def wget_inst_fzf():
    command = ' $host.UI.RawUI.WindowTitle = "wget🔽" ; winget search --exact "" | fzf --multi --preview-window=up:60% --preview \'winget show {1}\' | ForEach-Object { winget install $_.split()[0] }'
    try:
        subprocess.Popen([ 'start' , 'pwsh', '-Command', command], shell=True)
    except subprocess.CalledProcessError as e:
        print(f"Error executing command: {e}")

can u help me so the install command will open in a new window terminal