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

Suspend (CTRL-z) and close running CLI (CTRL-c) and various other behaviors causes "Copy to Clipboard" behavior to trigger #370

Closed
andrew-enquanta opened this issue Jul 4, 2024 · 11 comments

Comments

@andrew-enquanta
Copy link

Using the most recent bobthefish from omf on macOS, I get the following unwanted behaviors:

Suspend (CTRL-z)
close running CLI (CTRL-c)
piping anything to pbcopy

These all copies current path to clipboard.

I know it is bobthefish causing this because it immediately goes away when I omf remove bobthefish.

Please let me know if there is any other logging I can provide.

Thanks

@bobthecow
Copy link
Member

weird. i literally have no idea how that's happening.

what terminal are you using?

@andrew-enquanta
Copy link
Author

iTerm 2 (3.5.2) + tmux (3.4)

@andrew-enquanta
Copy link
Author

Maybe fish_clipboard_copy is getting called? running this in the terminal on its own copies the current path.

@bobthecow
Copy link
Member

0c15ff1#commitcomment-144040411 this is helpful!

what fish version are you running? do you have a path builtin?

@andrew-enquanta
Copy link
Author

andrew-enquanta commented Jul 9, 2024

fish, version 3.7.1

I did have a custom fish function called path which did pwd | pbcopy, but this problem persists even after I got rid of the custom function.

Otherwise, I don't quite know what you mean by "path builtin".

@bobthecow
Copy link
Member

that sounds an awful lot like the culprit, to be honest. run type -t path

@bobthecow
Copy link
Member

If I'm right, I just pushed a change that will fix your issue. Give it a shot?

@andrew-enquanta
Copy link
Author

This fixed it! Thank you

@bobthecow
Copy link
Member

Great to hear!

You should probably consider renaming your "copy the path" function to something that doesn't collide with a fish builtin :)

@bobthecow
Copy link
Member

Hey @andrew-enquanta, I’m going to need to revert this change; it turns out builtins are checked at parse time, not runtime, so making a conditional builtin call just breaks it for anyone who doesn’t have that builtin. See #371 for more info.

Given that LTS linux versions ship with Fishes too old for a path builtin, i’m going to need to revert this change.

I’ll keep looking for other workarounds, but at this point I think the proper fix is a very strong suggestion that you not have functions named the same thing as builtins :)

@andrew-enquanta
Copy link
Author

Copy that. thanks for the update

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

No branches or pull requests

2 participants