waveterm icon indicating copy to clipboard operation
waveterm copied to clipboard

[Bug]: fish_exit doesn't trigger

Open Helmchen-Lord opened this issue 1 year ago • 2 comments

Current Behavior

Wave doesn't trigger --on-event fish_exit when closing the terminal. With other terminals the event is triggered correctly if you use Fish as default shell.

Here is a function that is currently not working:

function save_last_dir_on_exit --on-event fish_exit
    # Save the current directory to a file
    echo (pwd) > $__fish_config_dir/.last_dir
end

Expected Behavior

Wave should trigger the fish_exit event when the terminal is closed.

Steps To Reproduce

  1. Insert the event from above into config.fish or as Function under fish/conf.d
  2. Set fish as default shell in Wave
  3. Start Wave
  4. Navigate to a folder with CD
  5. Close Wave
  6. .last_dir file is not created

Wave Version

v0.11.1

Platform

Linux

OS Version/Distribution

Arch Linux Kernel 6.13.5-arch1-1

Architecture

x64

Anything else?

No response

Questionnaire

  • [ ] I'm interested in fixing this myself but don't know where to start
  • [ ] I would like to fix and I have a solution
  • [ ] I don't have time to fix this right now, but maybe later

Helmchen-Lord avatar Mar 02 '25 12:03 Helmchen-Lord

Hi! am interested in fixing the issue but i need a little more clear context , maybe a screen recording or just a detailed explanation? thanks in advance

skubed0007 avatar Mar 06 '25 03:03 skubed0007

Sure, I'll try to describe it better:

  1. Fish must be installed.
  2. Add “term:localshellpath”: “fish” in the Wave Config file.
  3. In the "config.fish" file under "/home/YourUsr/.config/fish/" add the function “save_last_dir_on_exit” from above (nothing more).
  4. Start Wave and navigate to any folder via CD.
  5. Close Wave.

A “.last_dir” file should be created in the fish config folder after exiting the terminal, but this does not happen. If I do the same in e.g. Kitty or the default terminal of KDE, then the file is created.

I also noticed with the Fish extension Sponge that it does not work on exit with Wave and there “-on-event fish_exit” is also used.

Thanks for taking a look!

Helmchen-Lord avatar Mar 06 '25 13:03 Helmchen-Lord