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

glitches & annoyances on freebsd #3

Closed
bkw777 opened this issue Feb 20, 2024 · 3 comments
Closed

glitches & annoyances on freebsd #3

bkw777 opened this issue Feb 20, 2024 · 3 comments

Comments

@bkw777
Copy link
Owner

bkw777 commented Feb 20, 2024

  • help() makes a blank screen in any terminal, regardless if white or black background, and blindly typing q enter doesn't exit either, requires ctrl-c to exit, and after ctrl-c the terminal is fine, so it's not the terminal codes but some kind of hang.
  • the tty can get locked and unusable until reboot if you for instance unplug and re-plug the usb-serial adapter
@bkw777
Copy link
Owner Author

bkw777 commented Feb 21, 2024

Ok the help() problem is this chunk at the end that does indent and word-wrap without breaking words.

pdd.sh/pdd.sh

Line 450 in 222ade1

while ((${#b})) ;do

It prints $b with an indent prepended, up to the last $IFS before the total including indent reaches width $w.
Then removes the printed part from $b.
Loop until there is no $b left.

It's broken the same way on mac too.

@bkw777
Copy link
Owner Author

bkw777 commented Feb 23, 2024

It's getting stuck looping forever processing the line: #h Order Pizza
Copying ALL possible set and shopt settings from a working ubuntu session and pasting right into the script still does not make it work! There were only 3 settings different anyway.

All that loop is doing is finding the last word seperator within 0-to-$w, printing that part, and printing the remainder on a new line, until all of $b is printed, so there are any number of other ways to accomplish that. But it's just bizarre that even cloning the entire bash behavior settings doesn't make the two behave the same.

dump all settings
$ shopt -p ;shopt -o -p

Ubuntu

$ shopt -p ;shopt -o -p
shopt -u autocd
shopt -u assoc_expand_once
shopt -u cdable_vars
shopt -u cdspell
shopt -u checkhash
shopt -u checkjobs
shopt -s checkwinsize
shopt -s cmdhist
shopt -u compat31
shopt -u compat32
shopt -u compat40
shopt -u compat41
shopt -u compat42
shopt -u compat43
shopt -u compat44
shopt -s complete_fullquote
shopt -u direxpand
shopt -u dirspell
shopt -u dotglob
shopt -u execfail
shopt -s expand_aliases
shopt -u extdebug
shopt -s extglob
shopt -s extquote
shopt -u failglob
shopt -s force_fignore
shopt -s globasciiranges
shopt -s globskipdots
shopt -u globstar
shopt -u gnu_errfmt
shopt -s histappend
shopt -u histreedit
shopt -u histverify
shopt -u hostcomplete
shopt -u huponexit
shopt -u inherit_errexit
shopt -s interactive_comments
shopt -u lastpipe
shopt -u lithist
shopt -u localvar_inherit
shopt -u localvar_unset
shopt -u login_shell
shopt -u mailwarn
shopt -u no_empty_cmd_completion
shopt -u nocaseglob
shopt -u nocasematch
shopt -u noexpand_translation
shopt -u nullglob
shopt -s patsub_replacement
shopt -s progcomp
shopt -u progcomp_alias
shopt -s promptvars
shopt -u restricted_shell
shopt -u shift_verbose
shopt -s sourcepath
shopt -u varredir_close
shopt -u xpg_echo
set +o allexport
set -o braceexpand
set -o emacs
set +o errexit
set +o errtrace
set +o functrace
set -o hashall
set -o histexpand
set -o history
set +o ignoreeof
set -o interactive-comments
set +o keyword
set -o monitor
set +o noclobber
set +o noexec
set +o noglob
set +o nolog
set +o notify
set +o nounset
set +o onecmd
set +o physical
set +o pipefail
set +o posix
set +o privileged
set +o verbose
set +o vi
set +o xtrace

FreeBSD

shopt -u autocd
shopt -u assoc_expand_once
shopt -u cdable_vars
shopt -u cdspell
shopt -u checkhash
shopt -u checkjobs
shopt -s checkwinsize
shopt -s cmdhist
shopt -u compat31
shopt -u compat32
shopt -u compat40
shopt -u compat41
shopt -u compat42
shopt -u compat43
shopt -u compat44
shopt -s complete_fullquote
shopt -u direxpand
shopt -u dirspell
shopt -u dotglob
shopt -u execfail
shopt -s expand_aliases
shopt -u extdebug
shopt -u extglob
shopt -s extquote
shopt -u failglob
shopt -s force_fignore
shopt -s globasciiranges
shopt -s globskipdots
shopt -u globstar
shopt -u gnu_errfmt
shopt -u histappend
shopt -u histreedit
shopt -u histverify
shopt -s hostcomplete
shopt -u huponexit
shopt -u inherit_errexit
shopt -s interactive_comments
shopt -u lastpipe
shopt -u lithist
shopt -u localvar_inherit
shopt -u localvar_unset
shopt -u login_shell
shopt -u mailwarn
shopt -u no_empty_cmd_completion
shopt -u nocaseglob
shopt -u nocasematch
shopt -u noexpand_translation
shopt -u nullglob
shopt -s patsub_replacement
shopt -s progcomp
shopt -u progcomp_alias
shopt -s promptvars
shopt -u restricted_shell
shopt -u shift_verbose
shopt -s sourcepath
shopt -u varredir_close
shopt -u xpg_echo
set +o allexport
set -o braceexpand
set -o emacs
set +o errexit
set +o errtrace
set +o functrace
set -o hashall
set -o histexpand
set -o history
set +o ignoreeof
set -o interactive-comments
set +o keyword
set -o monitor
set +o noclobber
set +o noexec
set +o noglob
set +o nolog
set +o notify
set +o nounset
set +o onecmd
set +o physical
set +o pipefail
set +o posix
set +o privileged
set +o verbose
set +o vi
set +o xtrace

And the only differences are

  freebsd                     |  ubuntu
  shopt -u extglob            |  shopt -s extglob
  shopt -u histappend         |  shopt -s histappend
  shopt -s hostcomplete       |  shopt -u hostcomplete

But even pasting the entire list right into the script didn't make it work on freebsd.

@bkw777
Copy link
Owner Author

bkw777 commented Feb 23, 2024

Fixed with a4d1893

@bkw777 bkw777 closed this as completed Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant