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

fix(dotfiles): allow clearing aliases, disable import #1995

Merged
merged 2 commits into from
May 2, 2024
Merged

Conversation

ellie
Copy link
Member

@ellie ellie commented May 2, 2024

At the moment there are far too many edge cases to handle importing aliases.

  1. We need an interactive shell to print aliases. Without it, most shells won't report much.
  2. Many people have their shells print things on startup (graphics, fortunes, etc). This could be detected as an attempt to set an alias.

Rather than spend the next year finding import edge cases, I'm
disabling it for now. There's probably a better way we can do this?

Checks

  • I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle
  • I have checked that there are no existing pull requests for the same thing

ellie added 2 commits May 2, 2024 16:29
At the moment there are far too many edge cases to handle importing
aliases.

1. We need an interactive shell to print aliases. Without it, most
   shells won't report much.
2. Many people have their shells print things on startup (graphics,
   fortunes, etc). This could be detected as an attempt to set an alias.

 Rather than spend the next year finding import edge cases, I'm
 disabling it for now. There's probably a better way we can do this?
@ellie ellie merged commit 0639ff4 into main May 2, 2024
17 checks passed
@ellie ellie deleted the ellie/alias-clear branch May 2, 2024 15:53
@tessus
Copy link
Contributor

tessus commented May 2, 2024

Doesn't this change now clear aliases no matter what? e.g. also manually set aliases?

@ellie
Copy link
Member Author

ellie commented May 2, 2024

No matter what? The intent is for it to allow deleting all aliases to remove Atuin set config

I'm not sure on a use case for only deleting imported aliases - this was prompted by the linked issue but I think it's a good thing to have regardless. I should probably have clarified a bit better in the PR body

@tessus
Copy link
Contributor

tessus commented May 2, 2024

No, maybe I expressed myself poorly. I meant the following: in the function run, the alias store is cleared. Isn't run being run as an init function when atuin starts? This means all aliases are removed every time atuin is started.

P.S.: Since gh only shows the diff, I might have misunderstood the run function.

@ellie
Copy link
Member Author

ellie commented May 3, 2024

Ah I see! No, it doesn't. Run is part of the atuin dotfiles alias command, which contains a pattern match. The pattern match switches based on which subcommand is required, so whether that's alias set, alias clear, etc.

@tessus
Copy link
Contributor

tessus commented May 3, 2024

Thanks. Next time I'll click on view file...
Sorry for the noise.

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.

2 participants