Commit graph

560 commits

Author SHA1 Message Date
Carlos Alexandro Becker
64d69eb59b
feat(version): adds command to check current gum version (#775)
* feat(version): adds command to check current gum version

closes #352

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* Update version/command.go

Co-authored-by: Gareth Jones <Jones258@Gmail.com>

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: Gareth Jones <Jones258@Gmail.com>
2024-12-13 16:59:14 -03:00
Carlos Alexandro Becker
32786f7764
feat(spin): --show-stdout --show-stderr (#774)
closes #362
2024-12-13 14:34:10 -03:00
vahnrr
d1bfd569ca
feat(confirm): add --show-output (#427)
* feat(confirm): add `--show-output`

* feat(confirm): add `--show-output` model

---------

Co-authored-by: vahnrr <vahnrr@pm.me>
2024-12-12 16:02:19 -03:00
Carlos Alexandro Becker
74c1079c9d
feat(filter): ctrl+a to toggle select all (#770)
closes #388
2024-12-12 10:12:28 -03:00
Carlos Alexandro Becker
f921ebd07f
feat(file): add --header (#768)
* feat(file): add --header

closes #497

* fix: show help
2024-12-11 23:24:25 -03:00
Carlos Alexandro Becker
55120aead6
feat(choose): --selected="*" to select all (#769)
close #390

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-12-11 23:23:58 -03:00
Carlos Alexandro Becker
774667a943
feat(choose,confirm,file,filter,input,table,write): esc exit 1, ctrl+c exit 130, help arrow order (#771)
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-12-11 23:23:33 -03:00
Carlos Alexandro Becker
05614c8196
feat(table): set --print if stdout is not a terminal (#762)
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-12-11 14:22:26 -03:00
Carlos Alexandro Becker
cf2da6406c
fix(spin): if not a tty, only print title, do not open tty for stdin (#763)
closes #328
2024-12-11 14:17:03 -03:00
Carlos Alexandro Becker
2e53efc0ec
feat(style): trim line spaces (#767)
Lipgloss applies aligning on the string as given to it, and ascii art
usually contain left whitespaces to align things.

This adds an option to trim space on all lines of the input, before
giving it to lipgloss, so aligning use only non-whitespace content.
2024-12-11 14:00:55 -03:00
Carlos Alexandro Becker
6a37a14819
fix: update termenv to detect xterm, rio
closes #391

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-12-11 10:19:25 -03:00
dependabot[bot]
b45ae0e049
chore(deps): bump golang.org/x/text from 0.18.0 to 0.21.0 (#764)
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.18.0 to 0.21.0.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.18.0...v0.21.0)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-11 04:44:50 +00:00
dependabot[bot]
6f5b0d2d67
chore(deps): bump github.com/charmbracelet/x/ansi from 0.5.2 to 0.6.0 (#765)
Bumps [github.com/charmbracelet/x/ansi](https://github.com/charmbracelet/x) from 0.5.2 to 0.6.0.
- [Release notes](https://github.com/charmbracelet/x/releases)
- [Commits](https://github.com/charmbracelet/x/compare/ansi/v0.5.2...ansi/v0.6.0)

---
updated-dependencies:
- dependency-name: github.com/charmbracelet/x/ansi
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-11 04:44:38 +00:00
Carlos Alexandro Becker
b0c9c58302
fix(stdin): trim space instead of \n (#761)
we were trimming an ending \n, but it would then break a \r\n sequence, causing misrenders.

this fixes it

closes #682

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-12-10 21:27:13 -03:00
Carlos Alexandro Becker
8d611cb7df
fix(table): grow table rows based on --columns (#760)
* fix(table): grow table rows based on --columns

closes #411

* fix: merge
2024-12-10 21:26:49 -03:00
Carlos Alexandro Becker
a8cce1cad9
feat(table): --lazy-quotes and --fields-per-record (#759)
As per [csv.Reader].

closes #345
2024-12-10 21:18:13 -03:00
Carlos Alexandro Becker
bf06fce1c9
fix(table): set widths (#758)
I'm not sure about this, as it might be slow in big tables...

This will go through all rows, calculate their widths, and set it as the
column width if none was provided with `-w`.

```console
$ echo -e "a,b\naaaaaaaaaaaaaaaaaaaaaaa,bbbbbbbbbbbbbbbb" | gum table
 a  b
 …  …

$ echo -e "a,b\naaaaaaaaaaaaaaaaaaaaaaa,bbbbbbbbbbbbbbbb" | gum table
 a                        b
 aaaaaaaaaaaaaaaaaaaaaaa  bbbbbbbbbbbbbbbb

$ echo -e "a,b\naaaaaaaaaaaaaaaaaaaaaaa,bbbbbbbbbbbbbbbb" | gum table -w 5,5
 a      b
 aaaa…  bbbb…

```

closes #285
2024-12-10 21:17:53 -03:00
Carlos Alexandro Becker
2b090e8cb5
feat(table): add help (#756)
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-12-10 14:45:32 -03:00
Carlos Alexandro Becker
cc71f600f2
fix(table): ignore BOM (#757)
* fix(table): ignore BOM

closes #520

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* fix: lint issue

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* fix: simplify

* fix: better error

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-12-10 14:45:18 -03:00
Carlos Alexandro Becker
b58aad189a
docs(format): add table example
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-12-10 12:10:42 -03:00
Carlos Alexandro Becker
afb6111258
fix(spinner): set stdin and stderr
fixes #266

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-12-10 11:48:47 -03:00
Carlos Alexandro Becker
c25be3c8c3
feat(pager): make --soft-wrap the default
closes #744
2024-12-09 22:16:58 -03:00
Carlos Alexandro Becker
01892a027f
fix(write): max height, max chars (#753) 2024-12-09 20:53:54 -03:00
Carlos Alexandro Becker
2939e516cc
fix(pager): do not strip ansi sequences (#754) 2024-12-09 17:54:17 -03:00
Carlos Alexandro Becker
2e2b020541
fix(pager): use help bubble (#748) 2024-12-09 15:05:12 -03:00
Carlos Alexandro Becker
fb543c3294
fix: strip ansi sequences from stdin (#739)
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-12-09 14:44:43 -03:00
Carlos Alexandro Becker
71d7e6539c
feat: handle focus/blur events (#749)
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-12-09 14:41:29 -03:00
Carlos Alexandro Becker
4f469522d5
feat: handle interrupts and timeouts (#747) 2024-12-09 14:30:35 -03:00
Carlos Alexandro Becker
e30fc5ecdf
refactor: removing huh as a dep (#742)
* Revert "feat: huh gum write (#525)"

This reverts commit 4d5d53169e.

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* Revert "Use Huh for Gum Confirm (#522)"

This reverts commit f7572e387e.

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* revert: Use Huh for Gum Choose (#521)

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* revert: feat: huh for gum input (#524)

* revert: feat: huh file picker (#523)

* feat: remove huh

* fix: timeouts

* fix: lint issues

* fix(choose): quit on ctrl+q

ported over 63a3e8c8ce

* fix: ctrl+a to reverse selection

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* fix: better handle spin exit codes

* fix(file): bind --[no-]permissions and --[no-]size

* feat(confirm): show help

* fix(confirm): fix help style

* fix(file): help

* fix(input): --no-show-help doesn't work

* fix(input): help

* fix(file): keymap improvement

* fix(write): focus

* feat(write): ctrl+e, keymaps, help

* feat(choose): help

* feat(filter): help

* refactor: keymaps

* fix(choose): only show 'toggle all' if there's no limit

* fix(choose): don't show toggle if the choices are limited to 1

* fix(filter): match choose header color

* fix(filter): add space above help

* fix(filter): factor help into the height setting

* chore(choose,filter): use verb for navigation label in help

* fix(filter): hide toggle help if limit is 1

* fix(file): factor help into height setting (#746)

* fix: lint issues

* fix(file): handle ctrl+c

* fix: remove full help

* fix: lint

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: Christian Rocha <christian@rocha.is>
2024-12-09 13:18:35 -03:00
dependabot[bot]
d74e9ea531
chore(deps): bump github.com/alecthomas/kong from 1.5.1 to 1.6.0 (#750)
Bumps [github.com/alecthomas/kong](https://github.com/alecthomas/kong) from 1.5.1 to 1.6.0.
- [Commits](https://github.com/alecthomas/kong/compare/v1.5.1...v1.6.0)

---
updated-dependencies:
- dependency-name: github.com/alecthomas/kong
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-09 04:16:12 +00:00
Olaf Alders
a5fb6b1798
docs: quote tmux session name in code sample (#745)
A tmux session name could contain a space. Quote the variable to avoid
the session name being split on spaces.
2024-12-06 15:13:48 -03:00
Carlos Alexandro Becker
29250f8feb
fix(filter): --no-strict not working, also weird behavior (#737)
- `--no-strict` was erroring as non-existent option
- when `--no-strict`, we should actually create a "fake" option with
  whatever the user is typing

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-12-04 10:34:22 -03:00
Carlos Alexandro Becker
71af32ce16
fix(spin): properly redirect output
closes #690
2024-12-04 10:32:45 -03:00
Carlos Alexandro Becker
c422e76fe3
fix: clarify filter --sort flag (#738)
* fix: clarify filter --sort flag

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* fix: if sort, sort options alphabetically first

* Revert "fix: if sort, sort options alphabetically first"

This reverts commit 86e8fc0a5b.

* fix: filter

* Update filter/options.go

Co-authored-by: Christian Rocha <christian@rocha.is>

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: Christian Rocha <christian@rocha.is>
2024-12-04 09:02:06 -03:00
Carlos Alexandro Becker
63a3e8c8ce
fix(filter): abort on ctrl+q (#721)
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-12-03 11:40:24 -03:00
ctn-malone
cb61fe6c84
chore(nix): update src hash (#733) 2024-12-03 11:39:51 -03:00
dependabot[bot]
90919986f2
chore(deps): bump github.com/alecthomas/kong from 1.5.0 to 1.5.1 (#736)
Bumps [github.com/alecthomas/kong](https://github.com/alecthomas/kong) from 1.5.0 to 1.5.1.
- [Commits](https://github.com/alecthomas/kong/compare/v1.5.0...v1.5.1)

---
updated-dependencies:
- dependency-name: github.com/alecthomas/kong
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-03 04:28:34 +00:00
dependabot[bot]
fef37dae1f
chore(deps): bump github.com/alecthomas/kong from 1.4.0 to 1.5.0 (#735)
Bumps [github.com/alecthomas/kong](https://github.com/alecthomas/kong) from 1.4.0 to 1.5.0.
- [Commits](https://github.com/alecthomas/kong/compare/v1.4.0...v1.5.0)

---
updated-dependencies:
- dependency-name: github.com/alecthomas/kong
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-02 04:16:50 +00:00
Carlos Alexandro Becker
c3e836f0dd
fix(spin): interrupt child process on ctrl+c (#732)
* fix(spin): interrupt child process on ctrl+c

This will send a SIGINT to the child process when ctrl+c is pressed.

closes #730

* fix: lint
2024-11-27 14:58:21 -03:00
Carlos Alexandro Becker
01f36b58a4
chore(deps): use huh main
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-11-26 12:43:44 -03:00
Carlos Alexandro Becker
fb11344ea4
fix(choose): --ordered (#722)
closes #687

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-11-26 12:42:54 -03:00
Pranav RK
620e645845
feat: allow cursor option in file (#667) 2024-11-26 12:42:27 -03:00
dependabot[bot]
e3ba400d6d
chore(deps): bump github.com/charmbracelet/bubbletea from 1.2.3 to 1.2.4 (#731)
Bumps [github.com/charmbracelet/bubbletea](https://github.com/charmbracelet/bubbletea) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/charmbracelet/bubbletea/releases)
- [Changelog](https://github.com/charmbracelet/bubbletea/blob/main/.goreleaser.yml)
- [Commits](https://github.com/charmbracelet/bubbletea/compare/v1.2.3...v1.2.4)

---
updated-dependencies:
- dependency-name: github.com/charmbracelet/bubbletea
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-26 04:38:37 +00:00
dependabot[bot]
1156c33ad5
chore(deps): bump github.com/charmbracelet/x/ansi from 0.5.0 to 0.5.2 (#729)
Bumps [github.com/charmbracelet/x/ansi](https://github.com/charmbracelet/x) from 0.5.0 to 0.5.2.
- [Release notes](https://github.com/charmbracelet/x/releases)
- [Commits](https://github.com/charmbracelet/x/compare/ansi/v0.5.0...ansi/v0.5.2)

---
updated-dependencies:
- dependency-name: github.com/charmbracelet/x/ansi
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-22 04:19:11 +00:00
dependabot[bot]
8ed2ca5e0d
chore(deps): bump github.com/charmbracelet/x/ansi from 0.4.5 to 0.5.0 (#728)
Bumps [github.com/charmbracelet/x/ansi](https://github.com/charmbracelet/x) from 0.4.5 to 0.5.0.
- [Release notes](https://github.com/charmbracelet/x/releases)
- [Commits](https://github.com/charmbracelet/x/compare/ansi/v0.4.5...ansi/v0.5.0)

---
updated-dependencies:
- dependency-name: github.com/charmbracelet/x/ansi
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-21 04:56:03 +00:00
dependabot[bot]
06bdaba08f
chore(deps): bump github.com/charmbracelet/bubbletea from 1.2.2 to 1.2.3 (#726)
Bumps [github.com/charmbracelet/bubbletea](https://github.com/charmbracelet/bubbletea) from 1.2.2 to 1.2.3.
- [Release notes](https://github.com/charmbracelet/bubbletea/releases)
- [Changelog](https://github.com/charmbracelet/bubbletea/blob/main/.goreleaser.yml)
- [Commits](https://github.com/charmbracelet/bubbletea/compare/v1.2.2...v1.2.3)

---
updated-dependencies:
- dependency-name: github.com/charmbracelet/bubbletea
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-20 04:37:21 +00:00
Carlos Alexandro Becker
098d09a270
fix(choose,confirm,file,filter,input,pager,spin): timeout default unit (#724)
Change it `0s` instead of `0`.

closes #402
2024-11-18 17:10:06 -03:00
Carlos Alexandro Becker
1ffe8b7e70
feat(log): support setting minimum log level with GUM_LOG_LEVEL (#723)
closes #490
2024-11-18 14:02:55 -03:00
Carlos Alexandro Becker
c868aa1c6c
fix(confirm,choose,file,input): timeout handling (#718)
* fix(confirm,choose,file,input): timeout handling

- some fields were not actually using the `--timeout` value
- some fields had different behavior when a timeout did occur. On this
  matter, it seems to me the best way forward is to specifically say it
  timed out, and after how long
- added exit status 124 (copied from `timeout` from coreutils) (fixes #684)

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* Update main.go

Co-authored-by: Ayman Bagabas <ayman.bagabas@gmail.com>

* Update internal/exit/exit.go

Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>

* fix: improve

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* fix: stderr

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: Ayman Bagabas <ayman.bagabas@gmail.com>
Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
2024-11-18 10:49:15 -03:00
Carlos Alexandro Becker
3cec9b7b9a
fix(filter): panic if no matches
closes #715

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-11-18 10:00:10 -03:00