I didn't realise at the time, but the tea.Program and the renderer share
the mutex. This make the code difficult to reason about - it turns out
the program sometimes acquires the lock and then calls the
`setAltScreen` method of the renderer which in turns calls `repaint`.
That causes a deadlock as `repaint` is trying to acquire the lock too.
* feat: add OSExec helper function for running exec.Cmds
* chore: for now, un-expose WrapExecCommand
* chore: move exec struff into its own file
* chore(exec): better name for Exec func that wraps exec.Cmd (thanks, @toby)
* docs: improve godoc on tick and every
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
* docs: small improvements
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
* docs: add loop examples for Tick/Every in GoDocs
* docs: small wording adjustments
* docs: small copy edits
Co-authored-by: Christian Rocha <christian@rocha.is>
* feat(keys): add support for shift/ctrl+arrow keys
* chore(keys): use sequences for shift/ctrl arrow keys
* feat(keys): support ctrl+shift+arrow keys
* chore(keys): use sequences for alt+arrows
* feat(keys): add support for arrow key combinations with alt modifiers
* fix(keys): remove an extreaneous check
* feat(keys): add support for urxvt arrow keys with modfiers
* feat(keys): add support for arrow keys in DECCKM mode
* docs(keys): expand on comment about ctrl+backtick
* chore(keys): migrate various bindings to sequences
* Minor comment improvements to the input parser
Co-authored-by: Bwahharharrr <yitang@tutanota.com>
* fix: replace keySP with working KeySpace
* test: update test to meet new reqs
* fix: fix test looking for 'space'
* fix(keys): set type to KeySpace when sending a space
* docs(keys): comments
Co-authored-by: Christian Rocha <christian@rocha.is>
* add: program.ReleaseTerminal and RestoreTerminal to re-use input & terminal
* chore(examples): add altscreen toggling to exec demo
* chore: put low-level altscreen stuff alongside other screen funcs
* docs: edit GoDocs for ReleaseTerminal and RestoreTerminal
* feat(renderer): add internal Msg renderMsg to immediately repaint
* fix: repaint instantly on RestoreTerminal
* fix: restore the altscreen state when restoring the terminal
* feat: implement Cmd-based API for blocking *exec.Cmds
* feat: allow Exec to return custom messages
* feat: allow Exec to be run without a callback
* fix: separate parameters for exec.Command examples
* fix: error message would get printed over by prompt in exec example
* fix: ignore signals while child process is running
* feat: allow to execute other things besides exec.Commands (#280)
* feat: allow to execute other things besides exec.Commands.
* fix: lint issues
* fix: renames, examples
* fix: callback type should be exported
* docs(exce): tiny ExecCommand doc comment correction
* chore(exec): break out Cmd for clarity's sake in example
* fix(exec): give the terminal a moment to catch up if exiting altscreen
* docs(exec): tidy up doc comments
* chore(exec): disambiguate methods for restoring the terminal state vs input
Co-authored-by: Christian Rocha <christian@rocha.is>
Co-authored-by: Carlos A Becker <caarlos0@gmail.com>
`errMsg(err)` -> `errMsg{err}`
Just noticed this while reading over the tutorial docs and figured I'd throw up a quick PR to address it.
Really enjoying the tooling so far, thank you for creating it!
* feat: update x/sys
current version breaks builds for windows/arm64
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
* fix: examples go.sum
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
* fix: tutorials go.sum
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>