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

Run recent command shows resolved aliases - ls appends --color=auto to executed command #156385

Closed
joyceerhl opened this issue Jul 26, 2022 · 13 comments · Fixed by #158794
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders terminal-shell-bash An issue in the terminal specific to bash terminal-shell-integration Shell integration, command decorations, etc. verified Verification succeeded
Milestone

Comments

@joyceerhl
Copy link
Contributor

Testing #156001

In Remote-WSL + bash + subshell, if I run ls and then use the command decoration to rerun the command, it instead runs ls --color=auto.

image

@meganrogge meganrogge added bug Issue identified by VS Code Team member as probable bug terminal-shell-integration Shell integration, command decorations, etc. labels Jul 27, 2022
@meganrogge meganrogge added this to the August 2022 milestone Jul 27, 2022
@Tyriar
Copy link
Member

Tyriar commented Aug 8, 2022

This is also the reason git may be replaced by hub; we're sending the alias resolved command line instead of the raw command line as input.

@Tyriar Tyriar added the terminal-shell-bash An issue in the terminal specific to bash label Aug 9, 2022
@Tyriar
Copy link
Member

Tyriar commented Aug 9, 2022

We should also verify this doesn't happen with aliases in zsh

@Tyriar Tyriar removed their assignment Aug 9, 2022
@meganrogge
Copy link
Contributor

fyi verifier, reproduces in normal bash in a non-subshell

@meganrogge
Copy link
Contributor

to reproduce:

  1. run alias in a bash terminal to see the ones you've defined
  2. run the part to the left of =
  3. via the command decoration menu, rerun command
  4. 🐛 the command's alias (part to the right of =) is the input

@meganrogge
Copy link
Contributor

We should also verify this doesn't happen with aliases in zsh

it does not

@meganrogge
Copy link
Contributor

the alias value is also displayed in the run recent command quickpick atm

meganrogge added a commit that referenced this issue Aug 9, 2022
meganrogge added a commit that referenced this issue Aug 9, 2022
This reverts commit 7df0c89.
@Tyriar
Copy link
Member

Tyriar commented Aug 10, 2022

I thought of an even better idea to what we talked about, we could use the old history method to supplement our current better method; if there are no problematic histcontrol settings and the latest history command changed between precious and now, assume it was an alias and use that?

@Tyriar Tyriar assigned Tyriar and unassigned meganrogge Aug 22, 2022
@VSCodeTriageBot VSCodeTriageBot added the unreleased Patch has not yet been released in VS Code Insiders label Aug 22, 2022
@Tyriar
Copy link
Member

Tyriar commented Aug 22, 2022

@joyceerhl could you verify this one when you get a chance?

@VSCodeTriageBot VSCodeTriageBot added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Aug 23, 2022
@joyceerhl joyceerhl added the verified Verification succeeded label Aug 23, 2022
@joyceerhl
Copy link
Contributor Author

🤔 still seems to repro in Remote-WSL
image

Version: 1.71.0-insider (user setup)
Commit: e3043eb
Date: 2022-08-23T10:56:12.685Z
Electron: 19.0.12
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Windows_NT x64 10.0.22000
Sandboxed: Yes

@joyceerhl joyceerhl removed the verified Verification succeeded label Aug 23, 2022
@Tyriar
Copy link
Member

Tyriar commented Aug 23, 2022

Does echo $HISTCONTROL show anything? My Ubuntu wsl shows ignoreboth in which case we cannot use that history method which is a known edge case that I don't think we can handle currently and is not worth tracking imo.

@joyceerhl
Copy link
Contributor Author

Yeah the output is ignoreboth. Is there a value I can change that to which would allow me to verify the fix?

@Tyriar
Copy link
Member

Tyriar commented Aug 23, 2022

@joyceerhl it can be set to the empty string or ignorespace - set this in your ~/.bashrc which should run before shell integration

@joyceerhl
Copy link
Contributor Author


image

@Tyriar Tyriar added the verified Verification succeeded label Aug 23, 2022
@Tyriar Tyriar changed the title Rerunning ls appends --color=auto to executed command Run recent command shows resolved aliases - ls appends --color=auto to executed command Aug 25, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Oct 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders terminal-shell-bash An issue in the terminal specific to bash terminal-shell-integration Shell integration, command decorations, etc. verified Verification succeeded
Projects
None yet
4 participants