From eafd8df583958a643338af52195d528d5e9ec1f1 Mon Sep 17 00:00:00 2001 From: Robin Olsen Date: Sat, 7 Feb 2026 12:12:43 +0100 Subject: [PATCH] defer terminal restoration add delete aliases --- pkg/cli/repl/repl.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/pkg/cli/repl/repl.go b/pkg/cli/repl/repl.go index 796f4fb..994404c 100644 --- a/pkg/cli/repl/repl.go +++ b/pkg/cli/repl/repl.go @@ -29,6 +29,8 @@ func RunREPL(ctx context.Context, config cli.CLIConfig) error { return fmt.Errorf("failed to get terminal state: %w", err) } + defer term.Restore(int(os.Stdin.Fd()), oldState) + svc, cleanup, err := service.NewServices(ctx, config) if err != nil { return fmt.Errorf("failed to initialize services: %w", err) @@ -87,10 +89,7 @@ func RunREPL(ctx context.Context, config cli.CLIConfig) error { args := strings.Fields(pmCmd) - output, err := commands.ExecuteArgsString(args) - if err != nil { - fmt.Fprintf(os.Stderr, "Error: %v\n", err) - } + output, _ := commands.ExecuteArgsString(args) if output != "" { fmt.Println(styles.CommandStyle.Render(output)) @@ -110,10 +109,6 @@ func RunREPL(ctx context.Context, config cli.CLIConfig) error { } } - if err := term.Restore(int(os.Stdin.Fd()), oldState); err != nil { - return fmt.Errorf("failed to restore terminal state: %w", err) - } - return nil } @@ -219,7 +214,7 @@ func flagSuggestions(cmd string, words []string, text string) []prompt.Suggest { case "describe", "get", "read": return issueIdSuggestions(words) - case "delete": + case "delete", "del", "rm", "remove": return issueIdSuggestions(words) }