Skip to content

Commit 438c84f

Browse files
authored
Merge pull request #206 from chu11/faq_prompt
faqs: add entry on shell prompt
2 parents 3196570 + 3f49d43 commit 438c84f

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

faqs.rst

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ F58 to another using the :core:man1:`flux-job` ``id`` subcommand, e.g.
7171
airline-alibi-index--tuna-maximum-adam
7272
$ flux job cancel airline-alibi-index--tuna-maximum-adam
7373
74-
.. _flux_run_mac:
75-
7674
With copy-and-paste, auto-completion, globbing, etc., it shouldn't be necessary
7775
to *type* a job ID with the ``ƒ`` prefix that often, but should you need to,
7876
use your terminal's method for inputting a
@@ -89,13 +87,51 @@ If your `Konsole <https://konsole.kde.org/>`_ terminal displays ``ƒ`` as ``Æ``
8987
check that Settings → Edit → Profile → Advanced → Encoding: Default
9088
Character Encoding is set to ``UTF-8``, not ``ISO8859-1``.
9189

90+
.. _flux_run_mac:
91+
9292
Does flux run on a Mac?
9393
=======================
9494

9595
Not yet. We have an open `issue <https://github.com/flux-framework/flux-core/issues/2892>`_
9696
on GitHub tracking the progress towards the goal of natively compiling on a
9797
mac. In the meantime, you can use Docker, see: :ref:`quickstart`.
9898

99+
.. _flux_shell_prompt:
100+
101+
Can you recommend a shell prompt?
102+
=================================
103+
104+
It can sometimes be tricky dealing with Flux hierarchies of instances. A common
105+
shell prompt adjustment used by Flux users adds Flux resource size and
106+
instance depth into the prompt. For example, the following prompt shows that
107+
we have 64 nodes of resources and are at depth 1.
108+
109+
.. code-block:: console
110+
111+
[s=64,d=1] $
112+
113+
To add this prompt into your shell, you can cut and paste the below or use it to
114+
adjust your current shell prompt. Note that the initial call to ``flux getattr size``
115+
is simply used to test if you are currently running on a system with Flux or not.
116+
117+
Cut and paste for ``.bashrc``
118+
119+
.. code-block:: sh
120+
121+
flux getattr size > /dev/null 2>&1
122+
if [ $? -eq 0 ]; then
123+
export PS1="[s=$(flux getattr size),d=$(flux getattr instance-level)] $"
124+
fi
125+
126+
Cut and paste for ``.cshrc``
127+
128+
.. code-block:: sh
129+
130+
flux getattr size >& /dev/null
131+
if ( $? == 0 ) then
132+
set prompt="[s=`flux getattr size`,d=`flux getattr instance-level`] $"
133+
endif
134+
99135
.. _bug_report_how:
100136
101137
How do I report a bug?

0 commit comments

Comments
 (0)