From 7b0bc0f75a1084bbf4ce5d408cbb5268efa4008b Mon Sep 17 00:00:00 2001 From: Gil Forsyth Date: Mon, 28 Mar 2022 12:13:11 -0400 Subject: [PATCH] fix: add M1 bash-completion path to osx defaults (#4740) * docs: change language choice for "reasonable" behavior * fix: add M1 bash completion location to defaults on OSX --- docs/comparison.rst | 2 +- docs/tutorial_subproc_strings.rst | 2 +- xonsh/completers/bash_completion.py | 2 +- xonsh/environ.py | 5 +++-- xonsh/platform.py | 5 +++-- xonsh/procs/specs.py | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/comparison.rst b/docs/comparison.rst index f74c017e5..98a3b166c 100644 --- a/docs/comparison.rst +++ b/docs/comparison.rst @@ -15,7 +15,7 @@ table lists built in features and capabilities that various tools may or may not - fish - IPython - xonsh - * - Sane language + * - Practical language - - - ✓ diff --git a/docs/tutorial_subproc_strings.rst b/docs/tutorial_subproc_strings.rst index 6821a22eb..234d320a1 100644 --- a/docs/tutorial_subproc_strings.rst +++ b/docs/tutorial_subproc_strings.rst @@ -90,7 +90,7 @@ In sh-langs, internal quote characters are removed. For instance: $ echo --key="value" --key=value -Xonsh considers this behavior insane. Instead, xonsh treats these +Xonsh considers this behavior suboptimal. Instead, xonsh treats these arguments as if they were surrounded in another, outer level of quotation (``'foo"bar"baz'``). Xonsh will keep the quotation marks when leading and trailing quotes are not matched. diff --git a/xonsh/completers/bash_completion.py b/xonsh/completers/bash_completion.py index 8ef50be85..461f6b719 100644 --- a/xonsh/completers/bash_completion.py +++ b/xonsh/completers/bash_completion.py @@ -316,7 +316,7 @@ def bash_completions( since it lazy-loads individual completion scripts. For both bash-completion v1.x and v2.x, paths of individual completion scripts (like ``.../completes/ssh``) do not need to be included here. The - default values are platform dependent, but sane. + default values are platform dependent, but reasonable. command : str or None, optional The /path/to/bash to use. If None, it will be selected based on the from the environment and platform. diff --git a/xonsh/environ.py b/xonsh/environ.py index dddad2e74..693060064 100644 --- a/xonsh/environ.py +++ b/xonsh/environ.py @@ -1691,7 +1691,7 @@ This is to reduce the noise in generated completions.""", "For both bash-completion v1.x and v2.x, paths of individual completion " "scripts (like ``.../completes/ssh``) do not need to be included here. " "The default values are platform " - "dependent, but sane. To specify an alternate list, do so in the run " + "dependent, but reasonable. To specify an alternate list, do so in the run " "control file.", default=BASH_COMPLETIONS_DEFAULT, doc_default=( @@ -1699,7 +1699,8 @@ This is to reduce the noise in generated completions.""", " ``('/usr/share/bash-completion/bash_completion', )``\n\n" "But, on Mac it is:\n\n" " ``('/usr/local/share/bash-completion/bash_completion', " - "'/usr/local/etc/bash_completion')``\n\n" + "'/usr/local/etc/bash_completion', " + "'/opt/homebrew/share/bash-completion/bash_completion'),``\n\n" "Other OS-specific defaults may be added in the future." ), type_str="env_path", diff --git a/xonsh/platform.py b/xonsh/platform.py index 074a33bbe..4b8ede45e 100644 --- a/xonsh/platform.py +++ b/xonsh/platform.py @@ -494,8 +494,9 @@ def BASH_COMPLETIONS_DEFAULT(): elif ON_DARWIN: bcd = ( "/usr/local/share/bash-completion/bash_completion", # v2.x - "/usr/local/etc/bash_completion", - ) # v1.x + "/usr/local/etc/bash_completion", # v1.x + "/opt/homebrew/share/bash-completion/bash_completion", # v2.x on M1 + ) elif ON_WINDOWS and git_for_windows_path(): bcd = ( os.path.join( diff --git a/xonsh/procs/specs.py b/xonsh/procs/specs.py index dcbe433a9..5b9afdf1e 100644 --- a/xonsh/procs/specs.py +++ b/xonsh/procs/specs.py @@ -705,7 +705,7 @@ class SubprocSpec: def _safe_pipe_properties(fd, use_tty=False): - """Makes sure that a pipe file descriptor properties are sane.""" + """Makes sure that a pipe file descriptor properties are reasonable.""" if not use_tty: return # due to some weird, long standing issue in Python, PTYs come out