mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-27 18:51:41 +02:00
Prevent invocation of command-palette from command line
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
|
||||
"github.com/kovidgoyal/kitty/tools/cli"
|
||||
"github.com/kovidgoyal/kitty/tools/fzf"
|
||||
"github.com/kovidgoyal/kitty/tools/tty"
|
||||
"github.com/kovidgoyal/kitty/tools/tui"
|
||||
"github.com/kovidgoyal/kitty/tools/tui/loop"
|
||||
"github.com/kovidgoyal/kitty/tools/wcswidth"
|
||||
@@ -621,6 +622,9 @@ func (h *Handler) triggerSelected() {
|
||||
}
|
||||
|
||||
func main(cmd *cli.Command, opts *Options, args []string) (rc int, err error) {
|
||||
if tty.IsTerminal(os.Stdin.Fd()) {
|
||||
return 1, fmt.Errorf("This kitten must only be run via a mapping in kitty.conf")
|
||||
}
|
||||
output := tui.KittenOutputSerializer()
|
||||
lp, err := loop.New()
|
||||
if err != nil {
|
||||
|
||||
@@ -119,7 +119,7 @@ def collect_keys_data(opts: Any) -> dict[str, Any]:
|
||||
|
||||
|
||||
def main(args: list[str]) -> None:
|
||||
raise SystemExit('This must be run as kitten command-palette')
|
||||
raise SystemExit('This kitten must be used only from a kitty.conf mapping')
|
||||
|
||||
|
||||
@result_handler(has_ready_notification=True)
|
||||
|
||||
Reference in New Issue
Block a user