Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement: install Homebrew fallback is noisey, needs to be in an alt TTY #234

Closed
balupton opened this issue Jul 10, 2024 · 2 comments
Closed
Labels
enhancement Improvement or suggestion
Milestone

Comments

@balupton
Copy link
Member

When installing on fresh macOS, installing Homebrew will be necessary when installing say KSH and Fish, in which case output gets noisey and confusing real quick. Homebrew is not clear why it is prompting for sudo, unlike Dorothy, and it is not clear that Homebrew is being installed.

Alternatively, something we could do is prompt the user which fallback they would like to install for the dependency, and if the dependency is optional, then provide the user the option of skipping installing it.

@balupton balupton added the enhancement Improvement or suggestion label Jul 10, 2024
@balupton balupton added this to the Share Launch milestone Jul 10, 2024
@balupton
Copy link
Member Author

This might have been solved by 7001569

balupton added a commit that referenced this issue Oct 27, 2024
…pabilities (#254)

/close #253 #234

- general:
    - use the correct quote/escape for the context
    - `IFS=''` to `IFS=` as they are equivalent
    - added a deprecation system with `dorothy-warnings` and `commands.deprecated` suggestions
    - change `echo` to either `__print_line` or `__print_lines`
    - compress multiple `echo-style` calls into a single call for performance
    - implement new styles where appropriate, however this is not comprehensive at all
    - rewrite quiet/verbose handling, now ignores the environment variable, which is a superior behaviour that prevents unexpected behaviour

- docs:
    - add `terminals-and-tty.md`:
        - debug information from `is-tty --test` moved into new `debug-terminal-(tty|stdin)` and learnings documented in this doc file
    - add ``ansi-escape-codes.md`:
        - moved ansi escape code documentation from various commands in this doc file
    - `prompts.md`:
        - remove outdated information and update with latest coventions
    - `readme`:
        - list @balupton's github list of [Dorothy User Configurations](https://github.com/stars/balupton/lists/dorothy-user-configurations)
        - remove unnecessary deps

- ci:
    - `dorothy-workflow.yml`:
        - support testing on branches and forks
        - remove unnecessary deps
    - `shellcheckrc`:
        - ignore `SC2016`, it is always intentional
        - ignore `SC2059`, it is always intentional
        - add docs on all the disabled rules

- deprecate `tty.bash`, `choose-menu`, `choose-option`, `echo-clear-line`, `echo-color-enabled`, `echo-element`, `echo-quiet-enabled`, `echo-title`, `is-color-enabled`, `is-interactive`, `is-match`, `is-quiet-enabled`, `is-tty`
    - refer to their source code or their warning messages for their replacements
    - `is-tty --test` debug information moved into `debug-terminal-(stdin|tty)` beta commands, and add more information
    - add `get-terminal-alternative-support`
    - add `get-terminal-color-support`:
        - if ci isn't github, continue to fail, however if dumb terminal and not ci, continue to fallback
            - this enables fallback on `ssh -T ...`, which does support colors
    - add `get-terminal-cursor-line-and-column`
    - add `get-terminal-device-file`
    - add `get-terminal-lines-and-columns`
    - add `get-terminal-position-support`
    - add `get-terminal-quiet-support`:
        - adapt for the `get-terminal-color-support` convention, however keep same functionality, this could be a mistake - will need to evaluate
    - add `get-terminal-reactivity-support`
    - add `get-terminal-size-support`
    - add `get-terminal-title-support`:
        - vscode doesn't support titles, so fail on vscode
    - add `get-terminal-tty-support`

- move `echo-exit-affirmative`, `echo-mkdir`, `echo-nothing-or-fail` to beta commands as they are no longer (or were never) used internally

- `stdinargs.bash`:
    - rewrite to use `[[ ... ]]` instead of `test`/`[` to better handle edge cases, such as a trailing line containing only `>`

- `bash.bash`:
    - remove deprecated usage of `__print_line ...`, use `__print_lines ...` instead
    - support initial `--` argument in appropriate functions
    - rewrite to use `[[ ... ]]` instead of `test`/`[` to better handle edge cases
    - add `__substr` shim, fix for `cpr` and `echo-style`
    - fix escape quoting in `mapfile` shim for bash v3
    - add some common helpers for performance, and use them wherever appropriate
        - add `__is_brew`, `__command_(missing|exists)`, `__try_sudo`, `__is_brew`, `__mkdirp`, `__sudo_mkdirp`, `__escape_shapeshifting`, `__is_shapeshifter`, `__can_read_decimal_timeout`
        - I did add `has_needles` however it wasn't justified compared to continuing `is-needle`

- `zsh.zsh`:
    - consistency with `bash.bash` changes

- `styles.bash` and `echo-style`:
    - `styles.bash`:
        - check various support abilities at the begining for clarity and performance
        - add styles for various ansi escape codes, for consolidation, and to ensure correct escape codes are used based on support, including that of `newline`
        - change clear screen to use `\e[J` instead of `\e[2J` for reasoning documented inside the file
        - if the alternative screen buffer is not used, then adapt the screen buffer and clear screen styles to be a newline and clear screen instead, this makes it so that even if clear screen is not supported, the newline still ensures things are visually separated, which works great for GitHub Actions
        - fix broken `code_notice` style and replace to `code-notice1`
        - rejigged styles for `ask`, `choose`, and `confirm` to be consistent and to support no-TTY mode
        - ensure that refreshed styles have their color and no color styles set appropriately
    - `echo-style`:
        - support `--=...`, `--=`, `--` arguments
        - `echo-style --tty` instead of `echo-style >/dev/tty` as the former can support when `/dev/tty` doesn't exist

- `ask`, `choose`, `confirm`, `read-key`, `is-shapeshifter`, `echo-count-lines`, `echo-clear-lines`, `echo-revolving-door`, `echo-wrap`, `eval-helper`:
    - significant changes to support no-TTY mode and to support all known edge cases
    - consistent commentary, result, and exception styling
    - `ask`:
        - rewrote for modern conventions and new stdin/tty learnings, properly supports no-TTY
        - fix read failures not being output
        - if non-reactive, use alternative screen buffer
            - added `--no-inline` option to force usage of alternative screen buffer if supported/reactive
            - this solves the impossibility of clearing the accurate amount of lines in no-TTY mode, as `ssh -T` and pipe/redirect/CI result in different line counts due to `ssh -T` outputting the enter key as a visual new line
    - `choose`:
        - don't crash on unknown keys, instead flash bell
        - improve performance of legend rendering
        - don't hide/show cursor on environments that don't support it
        - don't try to update the title on environments that don't support it
        - auto-select solo required item for `git-helper` use case
        - fix blockquote line being a different color or breaking colors
    - `confirm`: 
        - rewrote for no-TTY support, looks and behave differently, now being clear about all options and appropriate keys
        - also fixes a bug with `--required` not always enforcing requirement
        - rejig color and no-color rendering
    - `eval-helper`:
        - fix undefined columns
    - `echo-clear-lines`:
        - rewritten to support all known edge cases
        - `--piped` option has been removed, a new `--here-string` argument has been added
        - it calls `echo-wrap` to ensure correct behaviour
        - supports `--column=*` alias for `--width=*`, and supports `--count=*` option if we already know how many lines we want to clear
    - `echo-count-lines`:
        - note in its help that it does not wrap lines
    - `echo-revolving-door`:
        - rewrote to fix all known edge cases
    - `echo-wrap`:
        - fix help errors not showing, support --column=* alias for --width=*
    - `is-shapeshifter`:
        - rewrote and add tests, to fix all known edge cases
        - now uses `bash.bash` helpers
    - `read-key`:
        - went through and redid all the keys
        - add `(ctrl|alt|shift)+(left|right)` macos keys, add `ctrl+a` (all key)
        - rewrote for no-TTY support, and now supports multiple keys, as such callers need to take note
        - supporting multiple keys is essential in line buffer mode or when in bash v3 (bash v3 has a delay in which multiple keys may be sent)
        - will now output unknown keys

- `brew`:
    - fix duplication in error messages and improve styling

- `brew-installed`:
    - support `--quiet` argument
    - return exit status `46` if brew is not installed

- `(command-(exists|missing|working)|is-(brew|needle))`:
    - add tests
    - `command-working`:
        - if the command is missing, return exit status `3` instead of `1`

- `debug-network:`
    - fix bad maintenance over the years
    - add comment to avoid 632e605

- `dorothy`:
    - install `coreutils` on alpine, remove `ps` dependency
    - fix bad `remote_name` automation
    - prompt for lint upgrade before dev deps, to speed up UX
    - moved common helpers into `bash.bash`, and improved them
    - source the `bash.bash` that is appropriately local or remote
    - rejig clone and update to support `slug`/`branch`/`reference`/`remote-name`, properly enabling support for branches, PRs, and forks
    - remove update technique for legacy dorothy installations
        - turns out the modern technique was always failing due to issues in `git-helper` which are now resolved
        - the legacy technique is for before `git-helper` existed, and it has existed for a long time now, multiple years
    - add `__eval_wrap` helper for debug clarity

- `ask`, `dorothy`,` setup-util-bash`, `setup-util-gh`
    - use new `get-terminal-reactivity-support` command instead of the deprecated `is-interactive`

- `dorothy`, `dorothy-warnings`, `init.*`:
    - added `dorothy-warnings` for deprecations and other warnings
    - warnings will be output on new terminal instances if there are new warnings

- `dorothy`, `fs-realpath`, `symlink-helper`:
    - detect when alpine uses `busybox` or `coreutils` and react accordingly
        - `readlink` on alpine's `busybox` doesn't support needed options
        - `realpath` on alpine's `busybox` doesn't support any options
    - move alpine's `busybox` implementation to fallback
    - fix alpine symlink failures
    - `symlink-helper`:
        - fix situation when the symlink is broken

- `echo-regexp`, `echo-regexp.ts`:
    - fix including `stdinargs.bash` when it didn't need to
    - better support for character classes, supporting `[[:XXX:]]` and `[:XXX:]` forms

- `echo-file` and `get-terminal-theme`:
    - add `get-terminal-theme --ignore-cache` option
    - correctly handle `bat` theme in cases where theme could not be detected, such as inside `ssh -T`
    - improve the styling of `bat` and `plain` output

- `echo-quote`, `echo-escape-command`, `echo-escape-bash`, `echo-lines`, `config-helper`, `dorothy-config`, `fs-size`, `mount-helper`, `nvm-env`, `setup-dns`, `sudo-helper`, `video-merge`, and so on:
    - use appropriate quote format for the context
    - `echo-lines` and `config-helper`:
        - `--quote=` option now supports the type of quote format you want
        - in `config-helper` this will default to autodetection based on the filetype we are writing to
    - `echo-quote`:
        - add tests
        - support `--single` and `--double` arguments

- `(echo-(html|url)-coder|fs-dequarantine|get-desktop-theme|setup-util-(1password-cli|apple-(cli-tools|rosetta)|yt-dlp))`:
    - fix incorrect function names

- `echo-escape-special`:
    - fix everything being dumped together

- `echo-mkdir`:
    - moved to beta commands as it is no longer used internally
    - fixed it never actually working

- `echo-nothing-or-fail`:
    - moved to beta commands as it is no longer used internally
    - fixed it never actually working

- `echo-substr` new command:
    - as command alias for `__substr` helper in `bash.bash`

- `echo-wait`:
    - rejig some logic for clarity

- `expand-path-zsh` renamed to `expand-path.zsh`:
    - also rewrote for clarity and modern conventions

- `fs-rm`:
    - note when moving to trash is not available

- `get-font`:
    - improve performance

- `get-installer`:
    - add aliases for `setup-util-ps`

- `git-helper`:
    - improve the way remotes and protocols are gathered
    - add `verify` action and step
    - fix `path` not sent to `review` action
    - correctly handle no remotes, no origin, and multiple remotes

- `is-abort`:
    - remove `ignore-empty` option, and hardcode how it is handled

- `is-nonempty-file`:
    - add help and options

- `setup-util`:
    - redid the clearing functionality to implement modern conventions and support a wide range of edge cases, such as when installer outputs more than LINES, or when clear is not available, or when the installer needs interaction
    - don't remove non-xdg-bins when upgrading as that causes issues with homebrew if the homebrew-installed bin was removed but homebrew still thinks it is installed
    - improve performance by using new `bash.bash` helpers
    - improve performance by reducing separate `echo-style` calls
    - if uninstalling/upgrading the currently executing `bash`, output a warning
    - only output the installer output if there was output
    - improved performance by merging a few redundant calls
    - output to `/dev/tty` if supported and appropriate

- `setup-util-bash`:
    - compact `echo-style` calls for performance, include `setup-util --check` for performance
    - improvements to clearing
    - two workarounds implemented for when uninstalling/upgrading the currently executing bash
        - we will try to reload the command with an alternative bash
        - if unable to load an alternative bash, a notice will be outputted on what to expect

- `setup-environment-commands`: 
    - improve performance on `rubygems`
    - improve performance by using new `bash.bash` helpers
    - add support for `commands.deprecated`

- `setup-mac-brew`:
    - verify homebrew git repo is setup correctly with new `git-helper verify` action

- `setup-util-node`:
    - verify nvm git repo is setup correctly with new `git-helper verify` action

- add `setup-util-ps`

- `until-success`:
    - rewrote for new TTY conventions
    - things that should be output to the terminal device file are now outputted there
    - added `--delay=...` alias for `--interval=...`

- `waiter`:
    - removed vestigial `--magic` option

- `what-is-running`:
    - support `ps` and `procs`, and install the appropriate fallback if both are missing

- `video-merge`:
    - use `is-headful` which is appropriate, instead of the deprecated `is-tty`

- `oz`:
    - cleanup a little bit, now that docs are elsewhere

- new beta commands:
    - added `echo-revolving-screen` command that unfortunately doesn't work properly and I don't know why

merged commits:

- 4f66b71 [re-add --needle= prefix on needle option on is-needle calls, to prevent edge case failures when the needle looks like an option](4f66b71)
- 1c7b588 [brew-installed: fix comment typos](1c7b588)
- d2b29cb [use the correct quote/escape for the context](d2b29cb)
    - /ref https://github.com/bevry/dorothy/actions/runs/11512899768
- d605711 [ask: rewrote for new stdin/tty learnings, properly support no-TTY](d605711)
- 613cec8 [improvements to TTY and STDIN reporting](613cec8)
- 0dfebda [ask/choose/confirm: fix broken tests, although ask test has a clearing issue when testing](0dfebda)
- 099bb6b [ask/choose/confirm: complete no-TTY support](099bb6b)
- 52958a2 [shellcheck: ignore SC2016, it is always intentional](52958a2)
- 8324b75 [mprovements to clearing, and resolve setup-util(-bash) edge case](8324b75)
- 713322d [echo-clear-lines: prep for improvements](713322d)
- e8a0640 [readme: list @balupton's github list of Dorothy User Configurations](e8a0640)
- a3ba02f [debug-network: add comment to avoid 632e605](a3ba02f)
- a37639d [consistentcy for commands.deprecated](a37639d)
- d99a9a6 [add dorothy-warnings, a deprecation system](d99a9a6)
- 888b090 [styles: newline, clear, alt screen buffer adjustments for CI](888b090)
- cc483c3 [styles: newline and clear if alt screen buffer not supported](cc483c3)
    - /ref https://github.com/bevry/dorothy/actions/runs/11358441972/job/31592966478#step:2:2805
- 598918e [style.bash: clear screen if alt buffer not available](598918e)
    - /ref https://github.com/bevry/dorothy/actions/runs/11358242517/job/31592464176#step:2:3754
- 648843c [get-terminal-(alternative|title)-support fixed](648843c)
- 383e36a [don't output screen buffer styles if not supported](383e36a)
    - /ref https://github.com/bevry/dorothy/actions/runs/11357972748/job/31591723554#step:3:785
- b4ef3c8 [bash.bash: add __substr shim, fix for cpr and echo-style](b4ef3c8)
    - /ref https://github.com/bevry/dorothy/actions/runs/11345441621/job/31552330617#step:3:2984
- 5405c39 [choose and read-key bugfixes](5405c39)
- f62bebd [eval-helper: fix undefined columns](f62bebd)
    - /ref https://github.com/bevry/dorothy/actions/runs/11340094950/job/31535923344#step:4:71
- fc24131 [echo-file: fix bat usage, all: improve styling](fc24131)
- 41de4c2 [dorothy: install coreutils installed on alpine, remove ps dependency](41de4c2)
    - /ref https://github.com/bevry/dorothy/actions/runs/11338434503/job/31531633175#step:4:58
- a9a57f5 [dorothy, fs-realpath: detect when alpine uses busybox or coreutils and react accordingly](a9a57f5)
    - /ref https://github.com/bevry/dorothy/actions/runs/11337845512/job/31530095505#step:4:56
- 99ac325 [dorothy, fs-realpath: move alpine's implementation to fallback](99ac325)
    - /ref https://github.com/bevry/dorothy/actions/runs/11337745165/job/31529845513#step:4:36
- 369ff92 [dorothy, fs-realpath: readlink on alpine doesn't support needed options](369ff92)
- 06a2cae [dorothy, fs-realpath: realpath on alpine doesn't support options](06a2cae)
- acee8c9 [dorothy, symlink-helper: fix alpine symlink failures](acee8c9)
    - /ref 
https://github.com/bevry/dorothy/actions/runs/11323459946/job/31486170602#step:4:11
- 5def66e [WIP: removed tty.bash for get-terminal-* commands](5def66e)
- c71c557 [is-tty: add proc and -p tests](c71c557)
- 8a4583b [bash.bash: linting](8a4583b)
- e15cab8 [choose: try to fix choose prompt question title not showing on CI](e15cab8)
- 6b7f98a [choose: auto-select solo required item for git-helper use case](6b7f98a)
    - /ref https://github.com/bevry/dorothy/actions/runs/11267661909/job/31333162360#step:3:1812
    - /ref https://github.com/bevry/dorothy/actions/runs/11115550380/job/30884206594#step:3:1873
    - /ref https://github.com/bevry/dorothy/actions/runs/11277567607/job/31364020536#step:3:1873
    - /ref https://github.com/bevry/dorothy/actions/runs/11286493561/job/31390927875#step:3:2128
    - /ref https://github.com/bevry/dorothy/actions/runs/11286573839/job/31391154425#step:3:1896
    - /ref https://github.com/bevry/dorothy/actions/runs/11286652092/job/31391365190#step:3:2141
    - /ref https://github.com/bevry/dorothy/actions/runs/11287510416/job/31393567790#step:3:1797
    - /ref https://github.com/bevry/dorothy/actions/runs/11287614318/job/31393844817#step:3:1798
    - /ref https://github.com/bevry/dorothy/actions/runs/11287762099/job/31394250547#step:3:1861
- 64c9cf6 [bash.bash: add has_needles helper for performance](64c9cf6)
- 4193b8e [dorothy: fix bad remote_name automation](4193b8e)
- 7a3236c [setup-environment-commands: improve performance](7a3236c)
- 4098286 [confirm, read-key: linting](4098286)
- c48e182 [command-(missing|working): fix bad commit](c48e182)
- 7b9d99c [read-key: turns out the all key is ctrl+a](7b9d99c)
- ee11038 [fix mistakes in WIP commits](ee11038)
- b60ef24 [dorothy: rejig clone and update to all support slug/branch/reference/remote-name](b60ef24)
- 47f29cb [dorothy: add __eval_wrap helper for debug clarity](47f29cb)
- 2fc7757 [echo-wait: rejig some logic for clarity](2fc7757)
- 1dbdd43 [brew: fix duplication in error messages and improve styling](1dbdd43)
- 2582cdf [confirm: rejig color and no-color rendering](2582cdf)
- ba73e79 [read-key: rejig some lines for internal clarity](ba73e79)
- c7f31b1 [bash.bash: add common helpers for performance](c7f31b1)
- 2c1b508 [WIP: choose, confirm, read-key: improve no-TTY support](2c1b508)
- 7f91040 [choose, echo-wrap, read-key: support no-TTY](7f91040)
@balupton
Copy link
Member Author

Fixed in #254

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement or suggestion
Development

No branches or pull requests

1 participant