This plugin introduces OSC 133 escape sequences to your shell output to define input, output and prompt zones.
This is used by modern terminal emulators to provide functions such as folding, jumping, etc.
$ fisher install acomagu/fish-osc133
Fish shell plugin to make OSC 133 compat
This plugin introduces OSC 133 escape sequences to your shell output to define input, output and prompt zones.
This is used by modern terminal emulators to provide functions such as folding, jumping, etc.
$ fisher install acomagu/fish-osc133
I use a prompt that's similar to this (taken from the fish docs):
function fish_prompt
set -l last_status $status
# Prompt status only if it's not 0
set -l stat
if test $last_status -ne 0
set stat (set_color red)"[$last_status]"(set_color normal)
end
string join '' -- (set_color green) (prompt_pwd) (set_color normal) $stat '> '
end
The relevant bit is that before doing anything else, the prompt reads the $status
variable which holds the return code of the last command, and saves it to a local variable $last_status
. Then it goes about constructing the prompt string, running other commands which overwrite $status
in the process. It uses $last_status
to conditionally show a red error indicator in the prompt.
When using this plugin, I noticed that failing commands do not result in this indicator being added to the prompt. I believe the issue is that _osc133_setup
is running before the prompt, and overwrites the value of $status
. I determined this by commenting out each of the functions in the plugin and testing the behavior; with _osc133_setup
removed the status reporting works again (though at the expense of breaking some of the functionality of this plugin).
However, normally fish handles this situation (a function being declared with --on-event fish_prompt
) correctly. For example, with the above prompt, if I then add this:
function greet --on-event fish_prompt
echo "Hello!"
end
...then when I run false
, I see this:
~> false
Hello!
~[1]>
Where the [1]
is the indication that false
returned a nonzero exit code. So even though greet
is running echo
which returns zero, fish knows not to let that override the $status
value set after false
exited.
So, I'm not sure why this plugin overwrites $status
when the reduced example above seems to work fine. But maybe this info will be of some use if you feel inclined to look into the issue.
I'm getting an error on running fisher update
:
...
Updated 8 plugin/s
functions: Function '_fishprompt_saved_prompt' already exists. Cannot create copy 'fish_prompt'
Standard input (line 51):
functions -c fish_prompt _fishprompt_saved_prompt
^
in function '_osc133_setup'
in event handler: handler for generic event “fish_prompt”
(Type 'help functions' for related documentation)
I'm guessing that plugin files are being sourced again, and this is not expected.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.