1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335
|
<!DOCTYPE html>
<html lang="en" data-content_root="../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>status - query fish runtime information — fish-shell 4.2.1 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=4da8bbd6" />
<link rel="stylesheet" type="text/css" href="../_static/pydoctheme.css?v=f89b4716" />
<script src="../_static/documentation_options.js?v=6fb65176"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="string - manipulate strings" href="string.html" />
<link rel="prev" title="source - evaluate contents of file" href="source.html" />
<link rel="shortcut icon" type="image/png" href="../_static/fish.png" />
</head><body><div id="fmain">
<div class="related" role="navigation" aria-label="Related">
<h3>Navigation</h3>
<ul>
<li><img src="../_static/fish.png" alt=""
style="width: 80px; height: 80px; vertical-align: middle; margin-top: -1px"/></li>
<li><a href="https://fishshell.com/">fish-shell</a> »</li>
<a href="../index.html">fish-shell 4.2.1 documentation</a> »
<li class="nav-item nav-item-1"><a href="../commands.html" accesskey="U">Commands</a> »</li>
<li class="nav-item nav-item-this"><a href="">status - query fish runtime information</a></li>
<li class="right">
<div class="inline-search" role="search">
<form class="inline-search" action="../search.html" method="get">
<input placeholder="Quick search" type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</li>
<div id="old-docs-notice" style="display: none">
This documents an old version of fish.
<a href="../../current/">See the latest release.</a>
</div>
</ul>
</div>
<div class="document">
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<div>
<h3><a href="../index.html">Documents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../index.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../faq.html">Frequently asked questions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../interactive.html">Interactive use</a></li>
<li class="toctree-l1"><a class="reference internal" href="../language.html">The fish language</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../commands.html">Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fish_for_bash_users.html">Fish for bash users</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tutorial.html">Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="../completions.html">Writing your own completions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../prompt.html">Writing your own prompt</a></li>
<li class="toctree-l1"><a class="reference internal" href="../design.html">Design</a></li>
<li class="toctree-l1"><a class="reference internal" href="../relnotes.html">Release notes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../terminal-compatibility.html">Terminal Compatibility</a></li>
<li class="toctree-l1"><a class="reference internal" href="../contributing.html">Contributing To Fish</a></li>
<li class="toctree-l1"><a class="reference internal" href="../license.html">License</a></li>
</ul>
</div>
<search id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>
<div>
<h4><a href="../index.html">Sections</a></h4>
<ul>
<li><a class="reference internal" href="#">status - query fish runtime information</a><ul>
<li><a class="reference internal" href="#synopsis">Synopsis</a></li>
<li><a class="reference internal" href="#description">Description</a></li>
<li><a class="reference internal" href="#notes">Notes</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="status-query-fish-runtime-information">
<h1>status - query fish runtime information<a class="headerlink" href="#status-query-fish-runtime-information" title="Link to this heading">¶</a></h1>
<section id="synopsis">
<h2>Synopsis<a class="headerlink" href="#synopsis" title="Link to this heading">¶</a></h2>
<div class="highlight-fish-synopsis notranslate"><div class="highlight"><pre><span></span><span class="nf">status</span>
<span class="nf">status</span><span class="w"> </span><span class="no">is-login</span>
<span class="nf">status</span><span class="w"> </span><span class="no">is-interactive</span>
<span class="nf">status</span><span class="w"> </span><span class="no">is-interactive-read</span>
<span class="nf">status</span><span class="w"> </span><span class="no">is-block</span>
<span class="nf">status</span><span class="w"> </span><span class="no">is-breakpoint</span>
<span class="nf">status</span><span class="w"> </span><span class="no">is-command-substitution</span>
<span class="nf">status</span><span class="w"> </span><span class="no">is-no-job-control</span>
<span class="nf">status</span><span class="w"> </span><span class="no">is-full-job-control</span>
<span class="nf">status</span><span class="w"> </span><span class="no">is-interactive-job-control</span>
<span class="nf">status</span><span class="w"> </span><span class="no">current-command</span>
<span class="nf">status</span><span class="w"> </span><span class="no">current-commandline</span>
<span class="nf">status</span><span class="w"> </span><span class="no">filename</span>
<span class="nf">status</span><span class="w"> </span><span class="no">basename</span>
<span class="nf">status</span><span class="w"> </span><span class="no">dirname</span>
<span class="nf">status</span><span class="w"> </span><span class="no">fish-path</span>
<span class="nf">status</span><span class="w"> </span><span class="no">function</span>
<span class="nf">status</span><span class="w"> </span><span class="no">line-number</span>
<span class="nf">status</span><span class="w"> </span><span class="no">stack-trace</span>
<span class="nf">status</span><span class="w"> </span><span class="no">job-control</span><span class="w"> </span><span class="no">CONTROL_TYPE</span>
<span class="nf">status</span><span class="w"> </span><span class="no">features</span>
<span class="nf">status</span><span class="w"> </span><span class="no">test-feature</span><span class="w"> </span><span class="no">FEATURE</span>
<span class="nf">status</span><span class="w"> </span><span class="no">build-info</span>
<span class="nf">status</span><span class="w"> </span><span class="no">get-file</span><span class="w"> </span><span class="no">FILE</span>
<span class="nf">status</span><span class="w"> </span><span class="no">list-files</span><span class="w"> </span><span class="g g-Other">[</span><span class="no">PATH</span><span class="g g-Other">]</span>
<span class="nf">status</span><span class="w"> </span><span class="no">help-sections</span>
<span class="nf">status</span><span class="w"> </span><span class="no">terminal</span>
<span class="nf">status</span><span class="w"> </span><span class="no">test-terminal-feature</span><span class="w"> </span><span class="no">FEATURE</span>
</pre></div>
</div>
</section>
<section id="description">
<h2>Description<a class="headerlink" href="#description" title="Link to this heading">¶</a></h2>
<p>With no arguments, <code class="docutils literal notranslate"><span class="pre">status</span></code> displays a summary of the current login and job control status of the shell.</p>
<p>The following operations (subcommands) are available:</p>
<dl class="simple">
<dt><strong>is-command-substitution</strong>, <strong>-c</strong> or <strong>--is-command-substitution</strong></dt><dd><p>Returns 0 if fish is currently executing a command substitution.</p>
</dd>
<dt><strong>is-block</strong>, <strong>-b</strong> or <strong>--is-block</strong></dt><dd><p>Returns 0 if fish is currently executing a block of code.</p>
</dd>
<dt><strong>is-breakpoint</strong></dt><dd><p>Returns 0 if fish is currently showing a prompt in the context of a <a class="reference internal" href="breakpoint.html"><span class="doc">breakpoint</span></a> command. See also the <a class="reference internal" href="fish_breakpoint_prompt.html"><span class="doc">fish_breakpoint_prompt</span></a> function.</p>
</dd>
<dt><strong>is-interactive</strong>, <strong>-i</strong> or <strong>--is-interactive</strong></dt><dd><p>Returns 0 if fish is interactive - that is, connected to a keyboard.</p>
</dd>
<dt><strong>is-interactive-read</strong> or <strong>--is-interactive-read</strong></dt><dd><p>Returns 0 if fish is running an interactive <a class="reference internal" href="read.html"><span class="doc">read</span></a> builtin which is connected to a keyboard.</p>
</dd>
<dt><strong>is-login</strong>, <strong>-l</strong> or <strong>--is-login</strong></dt><dd><p>Returns 0 if fish is a login shell - that is, if fish should perform login tasks such as setting up <span class="target" id="index-0"></span><a class="reference internal" href="../language.html#envvar-PATH"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PATH</span></code></a>.</p>
</dd>
<dt><strong>is-full-job-control</strong> or <strong>--is-full-job-control</strong></dt><dd><p>Returns 0 if full job control is enabled.</p>
</dd>
<dt><strong>is-interactive-job-control</strong> or <strong>--is-interactive-job-control</strong></dt><dd><p>Returns 0 if interactive job control is enabled.</p>
</dd>
<dt><strong>is-no-job-control</strong> or <strong>--is-no-job-control</strong></dt><dd><p>Returns 0 if no job control is enabled.</p>
</dd>
<dt><strong>current-command</strong></dt><dd><p>Prints the name of the currently-running function or command, like the deprecated <span class="target" id="index-1"></span><a class="reference internal" href="../language.html#envvar-_"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">_</span></code></a> variable.</p>
</dd>
<dt><strong>current-commandline</strong></dt><dd><p>Prints the entirety of the currently-running commandline, inclusive of all jobs and operators.</p>
</dd>
<dt><strong>filename</strong>, <strong>current-filename</strong>, <strong>-f</strong> or <strong>--current-filename</strong></dt><dd><p>Prints the filename of the currently-running script. If the current script was called via a symlink, this will return the symlink. If the current script was received by piping into <a class="reference internal" href="source.html"><span class="doc">source</span></a>, then this will return <code class="docutils literal notranslate"><span class="pre">-</span></code>.</p>
</dd>
<dt><strong>basename</strong></dt><dd><p>Prints just the filename of the running script, without any path components before.</p>
</dd>
<dt><strong>dirname</strong></dt><dd><p>Prints just the path to the running script, without the actual filename itself. This can be relative to <span class="target" id="index-2"></span><a class="reference internal" href="../language.html#envvar-PWD"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PWD</span></code></a> (including just “.”), depending on how the script was called. This is the same as passing the filename to <code class="docutils literal notranslate"><span class="pre">dirname(3)</span></code>. It’s useful if you want to use other files in the current script’s directory or similar.</p>
</dd>
<dt><strong>fish-path</strong></dt><dd><p>Prints the absolute path to the currently executing instance of fish. This is a best-effort attempt and the exact output is down to what the platform gives fish. In some cases you might only get “fish”.</p>
</dd>
<dt><strong>function</strong> or <strong>current-function</strong></dt><dd><p>Prints the name of the currently called function if able, when missing displays “Not a function” (or equivalent translated string).</p>
</dd>
<dt><strong>line-number</strong>, <strong>current-line-number</strong>, <strong>-n</strong> or <strong>--current-line-number</strong></dt><dd><p>Prints the line number of the currently running script.</p>
</dd>
<dt><strong>stack-trace</strong>, <strong>print-stack-trace</strong>, <strong>-t</strong> or <strong>--print-stack-trace</strong></dt><dd><p>Prints a stack trace of all function calls on the call stack.</p>
</dd>
<dt><strong>job-control</strong>, <strong>-j</strong> or <strong>--job-control</strong> <em>CONTROL_TYPE</em></dt><dd><p>Sets the job control type to <em>CONTROL_TYPE</em>, which can be <strong>none</strong>, <strong>full</strong>, or <strong>interactive</strong>.</p>
</dd>
<dt><strong>features</strong></dt><dd><p>Lists all available <a class="reference internal" href="../language.html#featureflags"><span class="std std-ref">feature flags</span></a>.</p>
</dd>
<dt><strong>test-feature</strong> <em>FEATURE</em></dt><dd><p>Returns 0 when FEATURE is enabled, 1 if it is disabled, and 2 if it is not recognized.</p>
</dd>
<dt><strong>build-info</strong></dt><dd><p>This prints information on how fish was build - which architecture, which build system or profile was used, etc.
This is mainly useful for debugging.</p>
</dd>
</dl>
<dl id="status-get-file">
<dt><strong>get-file</strong> <em>FILE</em></dt><dd><p>NOTE: this subcommand is mainly intended for fish’s internal use; let us know if you want to use it elsewhere.</p>
<p>This prints a file embedded in the fish binary at compile time. This includes the default set of functions and completions,
as well as the man pages and themes. Which files are included depends on build settings.
Returns 0 if the file was included, 1 otherwise.</p>
</dd>
<dt><strong>list-files</strong> <em>FILE</em></dt><dd><p>NOTE: this subcommand is mainly intended for fish’s internal use; let us know if you want to use it elsewhere.</p>
<p>This lists the files embedded in the fish binary at compile time. Only files where the path starts with the optional <em>FILE</em> argument are shown.
Returns 0 if something was printed, 1 otherwise.</p>
</dd>
<dt><strong>help-sections</strong></dt><dd><p>NOTE: this subcommand is intended for fish’s internal use.</p>
<p>List section arguments for the <a class="reference internal" href="help.html"><span class="doc">help</span></a> command.
If you have the latest version of fish, these URL fragments are valid on <a class="reference external" href="https://fishshell.com/docs/current/">https://fishshell.com/docs/current/</a>.
Always returns 0.</p>
</dd>
</dl>
<dl class="simple" id="status-terminal">
<dt><strong>terminal</strong></dt><dd><p>Prints the name and version of the terminal fish is running inside (for example as reported via <a class="reference internal" href="../terminal-compatibility.html#term-compat-xtversion"><span class="std std-ref">XTVERSION</span></a>).
This is not available during early startup but only starting from when the first interactive prompt is shown, possibly via builtin <a class="reference internal" href="read.html"><span class="doc">read</span></a>,
so before the first <code class="docutils literal notranslate"><span class="pre">fish_prompt</span></code> or <code class="docutils literal notranslate"><span class="pre">fish_read</span></code> <a class="reference internal" href="../language.html#event"><span class="std std-ref">event</span></a>.</p>
</dd>
</dl>
<dl id="status-test-terminal-features">
<dt><strong>test-terminal-feature</strong> <em>FEATURE</em></dt><dd><p>Returns 0 when the terminal was <a class="reference internal" href="../terminal-compatibility.html#term-compat-xtgettcap"><span class="std std-ref">detected</span></a> to support the given feature.
Like <a class="reference internal" href="#status-terminal"><span class="std std-ref">status terminal</span></a>, this only works once the first interactive prompt is shown.</p>
<p>Currently the only available <em>FEATURE</em> is <a class="reference internal" href="../terminal-compatibility.html#term-compat-indn"><span class="std std-ref">scroll-content-up</span></a>.
An error will be printed when passed an unrecognized feature.</p>
</dd>
</dl>
</section>
<section id="notes">
<h2>Notes<a class="headerlink" href="#notes" title="Link to this heading">¶</a></h2>
<p>For backwards compatibility most subcommands can also be specified as a long or short option. For example, rather than <code class="docutils literal notranslate"><span class="pre">status</span> <span class="pre">is-login</span></code> you can type <code class="docutils literal notranslate"><span class="pre">status</span> <span class="pre">--is-login</span></code>. The flag forms are deprecated and may be removed in a future release.</p>
<p>You can only specify one subcommand per invocation even if you use the flag form of the subcommand.</p>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="Related">
<h3>Navigation</h3>
<ul>
<li><img src="../_static/fish.png" alt=""
style="width: 80px; height: 80px; vertical-align: middle; margin-top: -1px"/></li>
<li><a href="https://fishshell.com/">fish-shell</a> »</li>
<a href="../index.html">fish-shell 4.2.1 documentation</a> »
<li class="nav-item nav-item-1"><a href="../commands.html" >Commands</a> »</li>
<li class="nav-item nav-item-this"><a href="">status - query fish runtime information</a></li>
<li class="right">
<div class="inline-search" role="search">
<form class="inline-search" action="../search.html" method="get">
<input placeholder="Quick search" type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</li>
<div id="old-docs-notice" style="display: none">
This documents an old version of fish.
<a href="../../current/">See the latest release.</a>
</div>
</ul>
</div>
<div class="footer">
© Copyright fish-shell developers.
<br />
<a href="https://github.com/fish-shell/fish-shell/issues">Found a bug</a>?
<br />
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 8.2.3.
</div>
</div>
<script type="text/javascript">
FISH_DOCS_VERSION = "4.2";
function copy_to_clipboard(it) {
// Find the pre tag we're interested in.
var pre = it.target;
while (pre.tagName != "PRE") pre = pre.parentNode;
var txt = "";
// Cheesy: If we have a prompt,
// we only copy prompted lines,
// by splitting and matching and stuff
if (pre.querySelector('span.gp')) {
var texts= [];
for (var line of pre.innerText.split('\n')) {
if (line.match(/^>_?.*/)) {
texts.push(line.replace(/^>_?/, ""));
}
}
txt = texts.join("\n");
} else {
// Even cheesier: If we don't have a prompt, we remove the button text from the end.
var txt = pre.innerText.substring(0, pre.innerText.length - it.target.innerText.length).trim();
}
navigator.clipboard.writeText(txt).then(function() {
// Success - set the text to indicate it,
// then set it back after 2 seconds.
var span = pre.querySelector("button span");
if (span) {
var oldText = span.innerText;
span.innerText = "COPIED!";
setTimeout(function() {
span.innerText = oldText;
}, 2000);
}
}, function() {
});
}
(function () {
// Add copy buttons to all the codeblocks.
var codeblocks = document.querySelectorAll('div > pre');
var button = document.createElement('button');
var span = document.createElement('span');
span.innerText = "COPY";
button.appendChild(span);
for (var i of codeblocks) {
var newButton = button.cloneNode(true);
newButton.addEventListener('click', copy_to_clipboard);
i.appendChild(newButton);
}
})();
</script>
</body>
</html>
|