Fish
Fish doesn’t use PS1; it uses a fish_prompt function. The built-in profile provides a starting point:
extensions:
term:
profile: fishThis sets shell: fish, shell-args: ["--no-config"], prompt: ">", and ps2: "". Since fish needs a custom prompt function and ps2-regex for continuation detection, you’ll typically override these:
extensions:
term:
profile: fish
shell-args:
- "--no-config"
- "-C"
- "`function fish_prompt; echo -n '$ '; end; set fish_color_command blue; ...`"
prompt: "$"
ps2-regex: "^\\s*$"Note: wrap the -C argument in backticks to prevent pandoc from mangling the quoted characters. The fish_color_* variables enable syntax highlighting for commands, keywords, parameters, strings, etc.
Basic Usage
echo "Hello from fish $FISH_VERSION"
Hello from fish 3.7.0
For Loops
for i in (seq 5)
echo "Item $i"
end
Item 1
Item 2
Item 3
Item 4
Item 5
String Manipulation
set greeting "Hello, World!"
echo (string upper $greeting)
HELLO, WORLD!
echo (string replace "World" "Fish" $greeting)
Hello, Fish!
Lists
set fruits apple banana cherry
for fruit in $fruits
echo "I like $fruit"
end
I like apple
I like banana
I like cherry
echo "Count: "(count $fruits)
Count: 3