简体   繁体   中英

Start gnome-terminal with interactive program

I'm trying to get fzf , an interactive fuzzy finder, running in a new terminal when calling a particular keyboard shortcut. In a traditional terminal window, I either call fzf or type Ctrl + T to launch it. My problem is that I'm unable to reproduce this programmatically (so that I can assign it to a Gnome keyboard shortcut). gnome-terminal --command="fzf" tells me it couldn't find a process named fzf . gnome-terminal --command="xdotool key ctrl+t" doesn't do anything but does work if I call it from an open terminal window. Changing the profile preference that says the terminal should stay open after the command is run results in the terminal saying "the child process has ended with a 0 status". Is there a way to do this?

fzf is a shell function. That's why you can't just run it directly.

You would need to run your shell (possibly in interactive mode) to get the function to exist.

Alternatively find out (ie declare -f fzf in your shell) what command is actually being run and run that directly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM