mirror of
https://github.com/charmbracelet/gum
synced 2024-05-20 15:16:42 +02:00
Compare commits
No commits in common. "38521ff8708cd2e3a3a83327105c131e7dbfc374" and "97feb1b4d031eb3f2ac5ccb20fa1bfd368db0655" have entirely different histories.
38521ff870
...
97feb1b4d0
|
@ -197,7 +197,7 @@ gum input --password > password.txt
|
|||
|
||||
Prompt for some multi-line text.
|
||||
|
||||
Note: `CTRL+D` is used to complete text entry. `CTRL+C` and `esc` will cancel.
|
||||
Note: `CTRL+D` and `esc` are used to complete text entry. `CTRL+C` will cancel.
|
||||
|
||||
```bash
|
||||
gum write > story.txt
|
||||
|
|
|
@ -9,7 +9,6 @@ import (
|
|||
"github.com/alecthomas/kong"
|
||||
"github.com/charmbracelet/bubbles/filepicker"
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
"github.com/charmbracelet/gum/internal/exit"
|
||||
"github.com/charmbracelet/gum/style"
|
||||
)
|
||||
|
||||
|
@ -54,9 +53,6 @@ func (o Options) Run() error {
|
|||
}
|
||||
|
||||
m = tm.(model)
|
||||
if m.aborted {
|
||||
return exit.ErrAborted
|
||||
}
|
||||
|
||||
if m.selectedPath == "" {
|
||||
os.Exit(1)
|
||||
|
|
|
@ -20,7 +20,6 @@ import (
|
|||
type model struct {
|
||||
filepicker filepicker.Model
|
||||
selectedPath string
|
||||
aborted bool
|
||||
quitting bool
|
||||
}
|
||||
|
||||
|
@ -32,9 +31,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|||
switch msg := msg.(type) {
|
||||
case tea.KeyMsg:
|
||||
switch msg.String() {
|
||||
case "ctrl+c", "q", "esc":
|
||||
m.aborted = true
|
||||
m.quitting = true
|
||||
case "ctrl+c", "q":
|
||||
return m, tea.Quit
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue