mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-04 14:46:03 +00:00
Prevent invocation of command-palette from command line
This commit is contained in:
parent
347c829156
commit
4ec1fa5168
2 changed files with 5 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue