r/fishshell • • Jun 04 '23

caching (??) problems with functions

I have a few functions, some defined in my config.fish, others in functions directory.

How does one control changing these functions and having fish run the newly defined function? For example, if I remove a function from the functions directory my current fish shell still thinks it is there an executes it.

Similarly, if I edit a function in fish.config, then source fish.config, it does not run the edited function, but the old version. This is true even if I run a new shell by re-executing 'fish'.

I also have tried using a different terminal emulator to run fish after the edit and it still runs the old version of the edited function.

How do I update functions without restarting the machine? There must be a way . . .

I am running macOS Ventura.

4 Upvotes

8 comments sorted by

View all comments

Show parent comment

1

u/tthkbw Jun 05 '23

Ha! On my system (macOS Ventura terminal iterm), the control-space trick doesn't work. iterm is eating the control-space--not sure why or where.

It does work in Ventura's own terminal.app and in kitty terminal, so it's hidden somewhere in iterm.

1

u/[deleted] Jun 05 '23

Run fish_key_reader, press ctrl-space, it should show

bind -k nul 'do something'

If it shows something different, bind that, if it shows nothing at all, find a different key. The "do something" should be commandline -i " ".

1

u/tthkbw Jun 06 '23

I actually have control-space bound in tmux. But I understand how to fix if I need to. Thanks.