Skip to content

Conversation

@1Naim
Copy link
Member

@1Naim 1Naim commented Jun 9, 2025

Currently there is no way to pass additional arguments to this custom function, so for example history -R won't do anything. Make it accept arguments to correc this behaviour.

Fixes #18
Closes #20

@1Naim
Copy link
Member Author

1Naim commented Jun 9, 2025

Fixes #18

Currently there is no way to pass additional arguments to this custom
function, so for example `history -R` won't do anything. Make it accept
arguments to correc this behaviour.

Signed-off-by: Eric Naim <[email protected]>
end

# Fish command history
function history
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we're even overriding function here instead of creating an alias?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because alias is "much" slower than function. Fish specific, and generally recommended to do functions instead

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea, but even if we do something like

alias history="history --show-time='%F %T '"

It will still use the builtin function so it's identical. I guess it's can be kept too because of #19

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because alias is "much" slower than function. Fish specific, and generally recommended to do functions instead

Fish documentation seems to say that alias does the same thing, just creating a wrapper for the command.

alias is a simple wrapper for the function builtin, which creates a function wrapping a command. It has similar syntax to POSIX shell alias. For other uses, it is recommended to define a function.

https://fishshell.com/docs/current/cmds/alias.html#alias-create-a-function

So I don't see why it should be faster.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it was equally good optimised after Rust rewrite

fish-shell/fish-shell#6023 (comment)

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.

History command is in wrong order? Custom CachyOS FISH configuration broken part of functonality

4 participants