Skip to content

Commit

Permalink
chatgpt: Update clear not to delete scrollback
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidGamba committed Aug 30, 2023
1 parent 644c145 commit 79d8a76
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion chatgpt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ func Run(ctx context.Context, opt *getoptions.GetOpt, args []string) error {
// Reset chat context
messageHistory = &[]openai.ChatCompletionMessage{}
case ".clear", "clear":
fmt.Printf("\033[H\033[2J")
// clear but save contents into scrollback
fmt.Printf("\033[H\033[22J")
case ".image":
mode = "image"
color.New(color.FgBlue).Println("Changed mode to image")
Expand Down

0 comments on commit 79d8a76

Please sign in to comment.