Commit graph

48 commits

Author SHA1 Message Date
Carlos Alexandro Becker
6045525ab9
feat: adding --padding to most commands (#960)
* feat(filter,choose): allow UI to be padded

* feat: --padding everywhere

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

* fix: unrelated lint issue

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

* fix: filter

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

* fix: use ordered.Clamp

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

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: Christian Rocha <christian@rocha.is>
2025-09-05 13:55:10 -03:00
Carlos Alexandro Becker
4cedf9fca0
feat: --no-strip-ansi (#784)
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: Sridaran Thoniyil <sri7thon@gmail.com>
2024-12-17 13:56:19 -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
2939e516cc
fix(pager): do not strip ansi sequences (#754) 2024-12-09 17:54:17 -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
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
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
19a93b08b9
refactor(input): simplify echoMode
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-08-19 12:00:02 -03:00
Carlos Alexandro Becker
046a4d361e
fix: use 0 as default width (#634)
* fix: use 0 as default width

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

* fix: filter width

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-07-25 13:12:30 -04:00
Mikael Fangel
efb70a1302
input: make keymap backwards compatible (#579)
Co-authored-by: Maas Lalani <maas@lalani.dev>
2024-05-25 14:53:42 -04:00
Maas Lalani
a8712df2a7
Show help with Huh? (#587)
* chore(deps): bump deps

* feat: show help using huh?

* fix: lint

* fix: test.sh
2024-05-25 14:51:20 -04:00
Mikael Fangel
26178f8894
fix(input, write): re-enable cursor style (#592)
* input: uncomment cursor theme

* write: add theme to huh form
2024-05-25 14:42:44 -04:00
Maas Lalani
f75dfa668f
docs: add new gifs (#533)
* docs: add new gifs

* Update README.md

* docs: spin.gif

* docs: add spin.gif to readme

* fix: lint

* don't commit filter.tape
2024-04-05 04:16:25 -04:00
Maas Lalani
2f0ea96504
fix(input): width 2024-03-28 16:38:24 -04:00
Maas Lalani
589be38936
fix: textinput stdin read 2024-03-28 16:36:14 -04:00
Maas Lalani
4a560b1953
feat: huh for gum input (#524) 2024-03-28 16:29:08 -04:00
Maas Lalani
2d896f777e feat(filter): allow customizing placeholder 2024-01-13 15:33:58 -05:00
Maas Lalani
7e5b494ae4 feat(input): allow placeholder style customization 2024-01-13 15:33:58 -05:00
Maas Lalani
01a66511a1
Hide Style Flags consistently (#457)
* refactor: hide style flags on error to not clutter usage

* docs(style): add comment regarding dynamically hiding flags
2023-11-28 14:17:57 -05:00
Piero Lescano
dd557baf6a
fix(input): Avoid reading from stdin if --value is being used (#448) 2023-11-14 16:54:45 -05:00
Dieter Eickstaedt
6bf79aa899
feat: Timeout for Filter Command (#382) 2023-06-30 09:18:02 -04:00
Maas Lalani
8f17aa3f9a feat(write,input): add --cursor.mode=hide,blink,static 2023-06-05 16:08:40 -04:00
Maas Lalani
92c890e717
fix: use lipgloss.Width instead of runewidth.StringWidth 2023-05-11 22:21:09 -04:00
Maas Lalani
7f54b3b289 feat(write): width < 1 uses terminal width 2023-05-11 15:13:01 -04:00
Maas Lalani
11f23830c5
fix: use Cursor.Style instead of CursorStyle 2023-03-31 11:42:09 -04:00
Maas Lalani
240e163f01 feat(input): header values 2022-12-13 15:05:56 -05:00
Maas Lalani
2e4ddce3f7
fix: use program.Start 2022-10-17 20:23:59 -04:00
Maas Lalani
1479184f3f fix: satisfy all linters 2022-08-05 02:33:40 -04:00
Maas Lalani
46ce0e4761 feat: allow configuration via environment variables 2022-08-04 11:22:42 -04:00
Maas Lalani
bba0f3b1e0
refactor: remove unneeded set:"name=" 2022-08-03 12:28:02 -04:00
Mathias Griffe
06e8546366 feat: Make input and write textarea CharLimit configurable through options
Removes the hardcoded 400 chars CharLimit (default for textarea), and make the CharLimit configurable through an Option.
2022-08-03 11:20:09 -04:00
Maas Lalani
b670c6d674 refactor: bubble up ErrAborted 2022-07-30 21:42:48 -04:00
Maas Lalani
0baa0b98bd
fix(input): ctrl+c exit status 130 2022-07-30 21:29:09 -04:00
Maas Lalani
cb590e324e chore: fix linting 2022-07-30 18:04:26 -04:00
Christian Muehlhaeuser
66993d8ef1
Add soft & hard linter configs & workflows (#44)
* chore: add linter configs & workflows

* fix: ignore certain linter warnings

* fix: mark errors as intentionally ignored

* fix: avoid unnecessary conversion

* fix: handle template/renderer errors

* fix: mark intentionally unused code
2022-07-30 12:32:59 -04:00
Maas Lalani
5b7d006487 feat: add --password option for masked input 2022-07-29 11:21:23 -04:00
Maas Lalani
de59d7580d
fix: default to 40 2022-07-27 13:58:34 -04:00
Maas Lalani
44cc74e496
feat: autoresize textinput 2022-07-27 13:56:52 -04:00
Ayman Bagabas
eaef49cdbe
feat: autocompletion 2022-07-25 13:03:18 -04:00
Maas Lalani
5de4df66d2
refactor: add package comments describing behavior 2022-07-13 09:55:36 -04:00
Maas Lalani
7190822247
refactor(kong): Implement Run(...) error interface
Instead of needing to run the commands manually in main.go, we can implement the `Run(...) error` method to satisfy the command interface so that `kong` can Run our commands for us.
2022-07-12 22:33:52 -04:00
Maas Lalani
bf8d9964df
feat: allow initial values of input and write to be set via stdin 2022-07-12 16:30:17 -04:00
Maas Lalani
02e925ea57
refactor: use embedded style struct for all lipgloss styling
This commit uses the embedded style struct for styling in all components. The most notable example is `gum write` where there are many styles that are used and composed for each component of the command.
2022-07-12 16:08:33 -04:00
Maas Lalani
593cf711be
feat: Allow setting initial value for input and write 2022-07-11 16:53:13 -04:00
Maas Lalani
fa4f09a413
feat: Default accent color is 212 (Bubble Gum Pink) 2022-07-07 17:46:22 -04:00
Maas Lalani
2f07eacf50
feat: Add gum input command
Input provides a shell script interface for the text input bubble. It
can be used to prompt the user for some input. The text the user entered
will be sent to `stdout`.

```
gum input --placeholder "What's your Bubble Gum flavor?" > answer.text
````
2022-07-07 13:28:52 -04:00