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

Bug: choose without TTY (paging unsupported) will not render properly #253

Closed
balupton opened this issue Sep 30, 2024 · 1 comment · Fixed by #254
Closed

Bug: choose without TTY (paging unsupported) will not render properly #253

balupton opened this issue Sep 30, 2024 · 1 comment · Fixed by #254
Assignees
Labels
bug Broken or unexpected
Milestone

Comments

@balupton
Copy link
Member

balupton commented Sep 30, 2024

This has been visible on CI since the big choose rewrite several months ago, but never was able to reproduce locally until I was able to simulate a dead TTY via:

 ssh -T localhost 'bash -lc "choose --test"'

Tracked it down to when this is entered, output is incorrect:

	if test "$tty_target" = '/dev/stderr' || command-missing -- tput; then
		# fix [tput: No value for $TERM and no -T specified] errors when fetching columns and rows on CI
		paging_supported='no'
		style__hide_cursor=''
		style__show_cursor=''
	fi

So to work on this with just choose --test change the if test ... to if test 1 -eq 1 -o ...

@balupton balupton added the bug Broken or unexpected label Sep 30, 2024
@balupton balupton changed the title Bug: choose without TTY (paging unsupported) will not render properly Bug: choose without TTY (paging unsupported) will not render properly Sep 30, 2024
@balupton
Copy link
Member Author

balupton commented Oct 3, 2024

This has been fixed locally, and has also rolled out to confirm. Ask is up next. Need to test linger modes.

@balupton balupton self-assigned this Oct 17, 2024
@balupton balupton added this to the Share Launch milestone Oct 17, 2024
balupton added a commit that referenced this issue Oct 23, 2024
/close #253

- shellcheckrc: add `SC2059`, and add docs on all the disabled rules
- ask: rewrote for modern conventions, support no-TTY, fix read failures not being output
- ask/choose/confirm: consistent commentary styling
- choose: fix blockquote line being a different color or breaking colors
- confirm: fix and improve the WIP no-TTY support, now complete
- dorothy: prompt for lint upgrade before dev deps, to speed up UX
- echo-clear-lines: rewrote to support all known edge cases
- echo-count-lines: add note that it doesn't wrap
- echo-escape-command: use new `__quote` helped in `bash.bash` to support ANSI Escape Codes
- echo-quote: add tests, add support for `--single` and `--double` arguments
- echo-regexp(.ts)?: better support for character classes, supporting `[[:XXX:]]` and `[:XXX:]` forms
- echo-revolving-door: rewrote to support all known edge cases
- added `echo-substr`: as command alias for `__substr` helper in `bash.bash`
- echo-wrap: fix help errors not showing, support --column=* alias for --width=*
- eval-helper: updated for TTY changes, aand fix all known edge cases
- expand-path.zsh: same functionality, but rewrote for clarity
- setup-util: linting, and only output the output if there is output
- setup-util-bash: compact `echo-style` calls for performance, include `setup-util --check` for performance
- until-success: rewrote for new TTY conventions
- echo-escape-special: fix everything being dumped together
- is-shapeshifter: rewrote and add tests, to fix all known edge cases, and now uses `bash.bash` helpers
- 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
- stdinargs.bash:
    - rewrite to use [[ ... ]] instead of test/[ to better handle edge cases, such as a trailing line containing only `>`
- zsh.zsh:
    - consistency with `bash.bash` changes
    - rewrote and fixed `__substr` helper for edge cases
    - added `is_shapeshifter` and `__escape_shapeshifting` helpers, used in `is-shapeshifter`
- ansi-escape-codes.md: removed excess docs

todos:

- decide if ask/choose/confirm linger should be outputted to stderr if there is commentary and a sucess code but no linger, check if consistent with choose
- setup-util: consider new wrapper for the font selection too
balupton added a commit that referenced this issue Oct 23, 2024
/close #253

- shellcheckrc: add `SC2059`, and add docs on all the disabled rules
- ask: rewrote for modern conventions, support no-TTY, fix read failures not being output
- ask/choose/confirm: consistent commentary styling
- choose: fix blockquote line being a different color or breaking colors
- confirm: fix and improve the WIP no-TTY support, now complete
- dorothy: prompt for lint upgrade before dev deps, to speed up UX
- echo-clear-lines: rewrote to support all known edge cases
- echo-count-lines: add note that it doesn't wrap
- echo-escape-command: use new `__quote` helped in `bash.bash` to support ANSI Escape Codes
- echo-quote: add tests, add support for `--single` and `--double` arguments
- echo-regexp(.ts)?: better support for character classes, supporting `[[:XXX:]]` and `[:XXX:]` forms
- echo-revolving-door: rewrote to support all known edge cases
- added `echo-substr`: as command alias for `__substr` helper in `bash.bash`
- echo-wrap: fix help errors not showing, support --column=* alias for --width=*
- eval-helper: updated for TTY changes, aand fix all known edge cases
- expand-path.zsh: same functionality, but rewrote for clarity
- setup-util: linting, and only output the output if there is output
- setup-util-bash: compact `echo-style` calls for performance, include `setup-util --check` for performance
- until-success: rewrote for new TTY conventions
- echo-escape-special: fix everything being dumped together
- is-shapeshifter: rewrote and add tests, to fix all known edge cases, and now uses `bash.bash` helpers
- 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
- stdinargs.bash:
    - rewrite to use [[ ... ]] instead of test/[ to better handle edge cases, such as a trailing line containing only `>`
- zsh.zsh:
    - consistency with `bash.bash` changes
    - rewrote and fixed `__substr` helper for edge cases
    - added `is_shapeshifter` and `__escape_shapeshifting` helpers, used in `is-shapeshifter`
- ansi-escape-codes.md: removed excess docs

todos:

- decide if ask/choose/confirm linger should be outputted to stderr if there is commentary and a sucess code but no linger, check if consistent with choose
- setup-util: consider new wrapper for the font selection too
balupton added a commit that referenced this issue Oct 23, 2024
/close #253

- shellcheckrc: add `SC2059`, and add docs on all the disabled rules
- ask: rewrote for modern conventions, support no-TTY, fix read failures not being output
- ask/choose/confirm: consistent commentary styling
- choose: fix blockquote line being a different color or breaking colors
- confirm: fix and improve the WIP no-TTY support, now complete
- dorothy: prompt for lint upgrade before dev deps, to speed up UX
- echo-clear-lines: rewrote to support all known edge cases
- echo-count-lines: add note that it doesn't wrap
- echo-escape-command: use new `__quote` helped in `bash.bash` to support ANSI Escape Codes
- echo-quote: add tests, add support for `--single` and `--double` arguments
- echo-regexp(.ts)?: better support for character classes, supporting `[[:XXX:]]` and `[:XXX:]` forms
- echo-revolving-door: rewrote to support all known edge cases
- added `echo-substr`: as command alias for `__substr` helper in `bash.bash`
- echo-wrap: fix help errors not showing, support --column=* alias for --width=*
- eval-helper: updated for TTY changes, aand fix all known edge cases
- expand-path.zsh: same functionality, but rewrote for clarity
- setup-util: linting, and only output the output if there is output
- setup-util-bash: compact `echo-style` calls for performance, include `setup-util --check` for performance
- until-success: rewrote for new TTY conventions
- echo-escape-special: fix everything being dumped together
- is-shapeshifter: rewrote and add tests, to fix all known edge cases, and now uses `bash.bash` helpers
- 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
- stdinargs.bash:
    - rewrite to use [[ ... ]] instead of test/[ to better handle edge cases, such as a trailing line containing only `>`
- zsh.zsh:
    - consistency with `bash.bash` changes
    - rewrote and fixed `__substr` helper for edge cases
    - added `is_shapeshifter` and `__escape_shapeshifting` helpers, used in `is-shapeshifter`
- ansi-escape-codes.md: removed excess docs

todos:

- decide if ask/choose/confirm linger should be outputted to stderr if there is commentary and a sucess code but no linger, check if consistent with choose
- setup-util: consider new wrapper for the font selection too
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Broken or unexpected
Development

Successfully merging a pull request may close this issue.

1 participant