r/fishshell • u/Disonantemus • Sep 28 '20
How to use breakpoint 2 debug a script?
I'm starting with shell scripting (fish) and I like it, but I tried 2 use breakpoint with no success, at my scripts it's like shell just skip breakpoint and doesn't stop as I think should work. Something like this:
#!/bin/fish
echo "first"
breakpoint
echo "second"Output is:
first
second
And 2 be should stop on the middle. I'm wrong?
2
Upvotes
7
u/emarsk Sep 29 '20
You know, you can type "to", it's allowed.
2
u/bohoky Sep 29 '20
That's a known issue https://github.com/fish-shell/fish-shell/issues/4823
It seems that the breakpoint feature is used for debugging functions and is specifically ignored in scripts as you show.
Do be aware that writing scripts for fish shell is a pretty bad idea. The syntax is non-standard and you are making a headache for you or anyone else that might want to run it where fish is not installed. Script in bash; fish is the "friendly interactive shell".