Skip to content

fix: use shell-agnostic 'and' operator in sudo rule instead of hardcoded '&&'#1604

Open
rahul-COD3 wants to merge 1 commit into
nvbn:masterfrom
rahul-COD3:fix/sudo-shell-agnostic-and-operator
Open

fix: use shell-agnostic 'and' operator in sudo rule instead of hardcoded '&&'#1604
rahul-COD3 wants to merge 1 commit into
nvbn:masterfrom
rahul-COD3:fix/sudo-shell-agnostic-and-operator

Conversation

@rahul-COD3

Copy link
Copy Markdown

Fixes #1229

The sudo rule was hardcoding '&&' to detect and chain commands, but fish shell uses '; and ' instead. This change uses shell.and_() from thefuck's shell abstraction to get the correct 'and' operator for the user's shell.

Also changed the match check from command.script_parts (list) to command.script (full string) since the fish '; and ' operator spans multiple tokens.

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

Successfully merging this pull request may close these issues.

sudo.py assumes && for shell 'and'

1 participant