snipt

Ctrl+h for KB shortcuts

Bash

enable xterm 256 color

1
2
3
4
5
if [ -e /usr/share/terminfo/x/xterm-256color ]; then
        export TERM='xterm-256color'
else
        export TERM='xterm-color'
fi
https://snipt.net/embed/ea8e59911a67aced9e3c59e8fe8f184a/
/raw/ea8e59911a67aced9e3c59e8fe8f184a/
ea8e59911a67aced9e3c59e8fe8f184a
bash
Bash
5
2019-06-24T15:09:22
True
False
False
/api/public/snipt/33725/
enable-xterm-256-color
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="k">if</span> <span class="o">[</span> -e /usr/share/terminfo/x/xterm-256color <span class="o">]</span><span class="p">;</span> <span class="k">then</span> </span><span id="L-2"><a name="L-2"></a> <span class="nb">export</span> <span class="nv">TERM</span><span class="o">=</span><span class="s1">&#39;xterm-256color&#39;</span> </span><span id="L-3"><a name="L-3"></a><span class="k">else</span> </span><span id="L-4"><a name="L-4"></a> <span class="nb">export</span> <span class="nv">TERM</span><span class="o">=</span><span class="s1">&#39;xterm-color&#39;</span> </span><span id="L-5"><a name="L-5"></a><span class="k">fi</span> </span></pre></div> </td></tr></table>
bash, xterm