waveterm icon indicating copy to clipboard operation
waveterm copied to clipboard

alias name in .bashrc ending with dash '-' causes error

Open jgreenbow opened this issue 1 year ago • 1 comments

Describe the bug If an alias is declared in the .bashrc where the name ends in a dash, the shell cannot be initialized.

error: error reinitializing remote: error initializing shell: cannot parse bash declare output: bash-declare-output:7:73: - must be followed by an expression

To Reproduce Steps to reproduce the behavior:

  1. Add alias p-='popd' to your .bashrc
  2. Start a new local session tab (bash) or /reset a current one

Expected behavior Local bash session starts without error.

Screenshots If applicable, add screenshots to help explain your problem. image

Desktop (please complete the following information):

  • OS: Linux, x64
  • Version: Client Version 0.7.5 (20240502-224742)

Additional context This alias causes no issues in other terminal environments. The dash character is certainly acceptable as an interior character in an alias e.g. alias my-alias='echo'. Bash alias naming question on SO: Which characters are allowed in a bash alias. Bash alias naming in Bash Reference Manual - 6.6 Aliases

jgreenbow avatar May 07 '24 17:05 jgreenbow

As well, you cannot use such an alias defined in a running session. The alias command is successful with a return code of 0, but the alias does not apply.

p-: command not found

To Reproduce:

  1. Open a session
  2. Run the command alias p-='echo popd'
  3. Run the command p-

Screenshots

image

jgreenbow avatar May 07 '24 18:05 jgreenbow