mirror of
https://github.com/starship/starship.git
synced 2026-06-21 02:02:14 +07:00
New translations readme.md (Japanese)
[ci skip]
This commit is contained in:
@@ -1,14 +1,19 @@
|
||||
# 高度な設定
|
||||
|
||||
Starship は汎用性の高いシェルですが、時には特定の処理を行うために `starship.toml` を編集する以上のことをする必要があります。 このページでは starship で使用される、より高度な設定の一部を詳しく説明していきます。
|
||||
Starship は汎用性の高いシェルですが、時には特定の処理を行うために `starship.toml` を編集する以上のことをする必要があります。 このページでは starship で使用される、より高度な設定の一部を詳しく説明していきます。 このページでは starship で使用される、より高度な設定の一部を詳しく説明していきます。
|
||||
|
||||
> [!WARNING] The configurations in this section are subject to change in future releases of Starship.
|
||||
|
||||
## PowerShell の TransientPrompt
|
||||
|
||||
直前に出力されたプロンプトを置き換えることができます。 プロンプトの内容全てが常に必要ではない時に役立ちます。 有効にするには、 `Enable-TransientPrompt` をシェルで実行してください。 `$PROFILE` に追記することによって常時有効にすることが出来ます。 また、 `Disable-TransientPrompt` によっていつでも無効化することが出来ます。
|
||||
直前に出力されたプロンプトを置き換えることができます。 プロンプトの内容全てが常に必要ではない時に役立ちます。 To enable
|
||||
this, run `Enable-TransientPrompt` in the shell session. To make it permanent, put
|
||||
this statement in your `$PROFILE`. Transience can be disabled on-the-fly with
|
||||
`Disable-TransientPrompt`.
|
||||
|
||||
デフォルトでは、入力した文字列の左側を `>` で置換します。 カスタマイズするには、関数を `Invoke-Starship-TransientFunction` という名前で定義してください。 Starshipの `character` モジュールを表示する場合はこのようにします:
|
||||
By default, the left side of input gets replaced with `>`. To customize this,
|
||||
define a new function called `Invoke-Starship-TransientFunction`. For example, to
|
||||
display Starship's `character` module here, you would do
|
||||
|
||||
```powershell
|
||||
function Invoke-Starship-TransientFunction {
|
||||
@@ -22,15 +27,18 @@ Enable-TransientPrompt
|
||||
|
||||
## Cmd の TransientPrompt と TransientRightPrompt
|
||||
|
||||
Clink を使うと直前に出力したプロント文字列をカスタマイズできます。 全ての情報が必要では無い時に役に立ちます。 有効化するには次のコマンドを実行します。 `clink set prompt.transient <value>` 。 \<value\> には次のいずれかの値を指定します。
|
||||
Clink を使うと直前に出力したプロント文字列をカスタマイズできます。 プロンプトの内容全てが常に必要ではない時に役立ちます。 Clink を使うと直前に出力したプロント文字列をカスタマイズできます。 全ての情報が必要では無い時に役に立ちます。 有効化するには次のコマンドを実行します。 `clink set prompt.transient <value>` 。 \<value\> には次のいずれかの値を指定します。
|
||||
|
||||
- `always`: 直前に出力したプロンプト文字列を常に置換します。
|
||||
- `same_dir`: 作業ディレクトリが同じなら、直前に出力したプロンプト文字列を置換します。
|
||||
- `off`: プロンプト文字列を置換しません(無効化します)。
|
||||
|
||||
この操作が必要なのは1度だけです。 自分の `starship.lua` を次のように編集すると、プロンプト文字列の左側や右側に出力する文字列を変更できます。
|
||||
この操作が必要なのは1度だけです。 この操作が必要なのは1度だけです。 自分の `starship.lua` を次のように編集すると、プロンプト文字列の左側や右側に出力する文字列を変更できます。
|
||||
|
||||
- デフォルトでは、入力した文字列の左側を `>` へ置換します。 カスタマイズするには、新しい関数 `starship_transient_prompt_func` を定義します。 この関数の受け取る引数は今のプロンプト文字列で、あなたが変更できるようになっています。 Starshipの `character` モジュールを表示する場合はこのようにします:
|
||||
- By default, the left side of input gets replaced with `>`. To customize this,
|
||||
define a new function called `starship_transient_prompt_func`. This function
|
||||
receives the current prompt as a string that you can utilize. For example, to
|
||||
display Starship's `character` module here, you would do
|
||||
|
||||
```lua
|
||||
function starship_transient_prompt_func(prompt)
|
||||
@@ -41,7 +49,10 @@ end
|
||||
load(io.popen('starship init cmd'):read("*a"))()
|
||||
```
|
||||
|
||||
- デフォルトでは、入力した文字列の右側は空です。 カスタマイズするには、新しい関数 `starship_transient_rprompt_func` を定義します。 この関数の受け取る引数は今のプロンプト文字列で、あなたが変更できるようになっています。 例えば、直前のコマンドを実行した時刻を表示するには次のようにします。
|
||||
- デフォルトでは、入力した文字列の右側は空です。 To customize this, define a new
|
||||
function called `starship_transient_rprompt_func`. This function receives the
|
||||
current prompt as a string that you can utilize. For example, to display
|
||||
the time at which the last command was started here, you would do
|
||||
|
||||
```lua
|
||||
function starship_transient_rprompt_func(prompt)
|
||||
@@ -52,11 +63,16 @@ load(io.popen('starship init cmd'):read("*a"))()
|
||||
|
||||
## Fish の TransientPrompt と TransientRightPrompt
|
||||
|
||||
直前に出力されたプロンプトを指定の内容で置き換えることができます。 プロンプトの内容全てが常に必要ではない時に役立ちます。 有効にするには、 `enable_transience` を現在のシェルセッションで実行してください。 設定を永続化するにはこのコマンドを `~/.config/fish/config.fish` に記述してください。 また、 `disable_transience` を実行することでいつでも無効化できます。
|
||||
直前に出力されたプロンプトを置き換えることができます。 プロンプトの内容全てが常に必要ではない時に役立ちます。 To enable
|
||||
this, run `enable_transience` in the shell session. To make it permanent, put
|
||||
this statement in your `~/.config/fish/config.fish`. Transience can be disabled on-the-fly with
|
||||
`disable_transience`.
|
||||
|
||||
※Fishの場合は、コマンドラインが空ではなく構文的に正しい場合にのみ、transient プロンプトが出力されます。
|
||||
|
||||
- デフォルトでは入力した文字列の左側が太字・緑色の `❯` に置き換えられます。 カスタマイズするには、新しい関数 `starship_transient_prompt_func` を定義します。 Starshipの `character` モジュールを表示する場合はこのようにします:
|
||||
- By default, the left side of input gets replaced with a bold-green `❯`. To customize this,
|
||||
define a new function called `starship_transient_prompt_func`. For example, to
|
||||
display Starship's `character` module here, you would do
|
||||
|
||||
```fish
|
||||
function starship_transient_prompt_func
|
||||
@@ -66,7 +82,9 @@ starship init fish | source
|
||||
enable_transience
|
||||
```
|
||||
|
||||
- デフォルトでは、入力した文字列の右側は空です。 カスタマイズするには、新しい関数 `starship_transient_rprompt_func` を定義します。 例えば、直前のコマンドを実行した時刻を表示するには次のようにします。
|
||||
- デフォルトでは、入力した文字列の右側は空です。 To customize this, define a new
|
||||
function called `starship_transient_rprompt_func`. For example, to display
|
||||
the time at which the last command was started here, you would do
|
||||
|
||||
```fish
|
||||
function starship_transient_rprompt_func
|
||||
@@ -78,19 +96,29 @@ enable_transience
|
||||
|
||||
## Bash の TransientPrompt と TransientRightPrompt
|
||||
|
||||
バージョン 0.4 以降の [ble.sh](https://github.com/akinomyoga/ble.sh) の枠組みを用いると、直前に表示されたプロンプトを指定の文字列に置き換えることができます。 プロンプトの内容全てが常に必要ではない時に役立ちます。 有効にするには、 `~/.bashrc` に `bleopt prompt_ps1_transient=<value>` を記述してください。
|
||||
The [Ble.sh](https://github.com/akinomyoga/ble.sh) framework at v0.4 or higher allows you to replace
|
||||
the previous-printed prompt with custom strings. プロンプトの内容全てが常に必要ではない時に役立ちます。 バージョン 0.4 以降の [ble.sh](https://github.com/akinomyoga/ble.sh) の枠組みを用いると、直前に表示されたプロンプトを指定の文字列に置き換えることができます。 プロンプトの内容全てが常に必要ではない時に役立ちます。 有効にするには、 `~/.bashrc` に `bleopt prompt_ps1_transient=<value>` を記述してください。
|
||||
|
||||
\<value\> は `always`、 `same-dir` 、 `trim` からなるコロン区切りのリストです。 設定 `prompt_ps1_final` が空でかつ設定 `prompt_ps1_transient` が非空の \<value\> を持つ場合、 `PS1` に基づくプロンプトは現在のコマンドラインを去るときに消去されます。 \<value\> が `trim` を含む場合、複数行 `PS1` の最後の行だけを残して他の行は消去されます。 それ以外の場合は、あたかも `PS1=` が指定されたかのようにコマンドラインが再描画されます。 \<value\> が項目 `same-dir` を含む時に現在のワーキングディレクトリが前のコマンドラインの最終的なワーキングディレクトリと異なる場合、設定 `prompt_ps1_transient` は無視されます。
|
||||
The \<value\> here is a colon-separated list of `always`, `same-dir` and `trim`.
|
||||
When `prompt_ps1_final` is empty and the option `prompt_ps1_transient` has a non-empty \<value\>,
|
||||
the prompt specified by `PS1` is erased on leaving the current command line.
|
||||
If \<value\> contains a field `trim`, only the last line of multiline `PS1` is
|
||||
preserved and the other lines are erased. Otherwise, the command line will be
|
||||
redrawn as if `PS1=` is specified. When a field `same-dir` is contained in
|
||||
\<value\> and the current working directory is different from the final directory of
|
||||
the previous command line, this option `prompt_ps1_transient` is ignored.
|
||||
|
||||
左側や右側に transient プロンプトとして出力する文字列を変更するには、以下の変更を `~/.blerc` (または `~/.config/blesh/init.sh`) に適用してください。
|
||||
|
||||
- 入力文字列の左側を何に置き換えるか変更するには、 ble.sh 設定 `prompt_ps1_final` を設定します。 例えば Starship の `character` モジュールをここに表示するには、次のようにします。
|
||||
- 入力文字列の左側を何に置き換えるか変更するには、 ble.sh 設定 `prompt_ps1_final` を設定します。 例えば Starship の `character` モジュールをここに表示するには、次のようにします。 For example, to display Starship's `character`
|
||||
module here, you would do
|
||||
|
||||
```bash
|
||||
bleopt prompt_ps1_final='$(starship module character)'
|
||||
```
|
||||
|
||||
- 入力文字列の右側を何に置き換えるか変更するには、 ble.sh 設定 `prompt_rps1_final` を設定します。 例えば、直前のコマンドを実行した時刻を表示するには次のようにします。
|
||||
- 入力文字列の右側を何に置き換えるか変更するには、 ble.sh 設定 `prompt_rps1_final` を設定します。 例えば、直前のコマンドを実行した時刻を表示するには次のようにします。 For example, to display
|
||||
the time at which the last command was started here, you would do
|
||||
|
||||
```bash
|
||||
bleopt prompt_rps1_final='$(starship module time)'
|
||||
@@ -98,9 +126,12 @@ bleopt prompt_rps1_final='$(starship module time)'
|
||||
|
||||
## Cmdのカスタムの事前プロンプトおよび事前実行コマンド
|
||||
|
||||
Clinkはプロンプト表示前と実行前にCmd shellコマンドを実行するための非常に柔軟なAPIを提供します。 Starshipからこれを利用するのはとても簡単です。 好みに従って `starship.lua` を以下のように変更してください。
|
||||
Clinkはプロンプト表示前と実行前にCmd shellコマンドを実行するための非常に柔軟なAPIを提供します。 Starshipからこれを利用するのはとても簡単です。 Make the following changes
|
||||
to your `starship.lua` file as per your requirements:
|
||||
|
||||
- プロンプトが描画される直前に好みの関数を実行するには、 `starship_preprompt_user_func` という名前で新しい関数を定義してください。 この関数は現在のプロンプトを再利用できる文字列で受け取ります。 例として、ロケットをプロンプトの前に表示するには、以下のようにします。
|
||||
- 関数をプロンプトが描画される直前に実行するためには、新しい関数を定義して `starship_precmd_user_func` に割り当ててください。 例として、ロケットをプロンプトの前に表示させたければ、下記のようにしてください。 This function receives
|
||||
the current prompt as a string that you can utilize. For example, to
|
||||
draw a rocket before the prompt, you would do
|
||||
|
||||
```lua
|
||||
function starship_preprompt_user_func(prompt)
|
||||
@@ -110,7 +141,9 @@ end
|
||||
load(io.popen('starship init cmd'):read("*a")()
|
||||
```
|
||||
|
||||
- コマンドが実行される直前に好みの関数を実行するには、 `starship_precmd_user_func` という名前で新しい関数を定義してください。 この関数は現在のコマンドライン文字列を再利用できる文字列で受け取ります。 例えば、これから実行されるコマンドを出力するには、以下のようにします。
|
||||
- コマンドが実行される直前に好みの関数を実行するには、 `starship_precmd_user_func` という名前で新しい関数を定義してください。 この関数は現在のコマンドライン文字列を再利用できる文字列で受け取ります。 例えば、これから実行されるコマンドを出力するには、以下のようにします。 This function receives
|
||||
the current commandline as a string that you can utilize. For example, to
|
||||
print the command that's about to be executed, you would do
|
||||
|
||||
```lua
|
||||
function starship_precmd_user_func(line)
|
||||
@@ -123,8 +156,12 @@ load(io.popen('starship init cmd'):read("*a"))()
|
||||
## Bashのカスタムの事前プロンプトおよび事前実行コマンド
|
||||
|
||||
Bashには、他のほとんどのシェルとは違い、正式な preexec / precmd フレームワークを持っていません。 そのため、 `bash`で完全にカスタマイズ可能なフックを提供することは困難です。 ただし、Starship はプロンプトを描画する一連の流れに、限定的に独自の関数を挿入することができます。
|
||||
Because of this, it is difficult to provide fully customizable hooks in `bash`.
|
||||
ただし、Starship はプロンプトを描画する一連の流れに、限定的に独自の関数を挿入することができます。
|
||||
|
||||
- 関数をプロンプトが描画される直前に実行するためには、新しい関数を定義して `starship_precmd_user_func` に割り当ててください。 例として、ロケットをプロンプトの前に表示させたければ、下記のようにしてください。
|
||||
- To run a custom function right before the prompt is drawn, define a new
|
||||
function and then assign its name to `starship_precmd_user_func`. For example,
|
||||
to draw a rocket before the prompt, you would do
|
||||
|
||||
```bash
|
||||
function blastoff(){
|
||||
@@ -133,7 +170,9 @@ function blastoff(){
|
||||
starship_precmd_user_func="blastoff"
|
||||
```
|
||||
|
||||
- コマンドの直前に関数を実行するために、[`DEBUG` トラップの仕組み](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/)を使うことができます。 ただし、Starship を初期化する_前_に DEBUG シグナルをトラップ**しなければいけません**! Starship は DEBUGトラップの値を保護できますが、 starship の起動後にトラップが上書きされると、いくつかの機能は壊れてしまうでしょう。
|
||||
- コマンドの直前に関数を実行するために、[`DEBUG` トラップの仕組み](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/)を使うことができます。 ただし、Starship を初期化する_前_に DEBUG シグナルをトラップ**しなければいけません**!
|
||||
However, you **must** trap the DEBUG signal _before_ initializing Starship!
|
||||
Starship は DEBUGトラップの値を保護できますが、 starship の起動後にトラップが上書きされると、いくつかの機能は壊れてしまうでしょう。
|
||||
|
||||
```bash
|
||||
function blastoff(){
|
||||
@@ -148,6 +187,8 @@ set +o functrace
|
||||
## PowerShell のカスタム事前プロンプトおよび事前実行コマンド
|
||||
|
||||
PowerShell は、他のほとんどのシェルと違い、正式な preexec/precmd の枠組みを持ちません。 そのため、`powershell`で完全にカスタマイズ可能なフックを提供することは困難です。 ただし、Starship はプロンプトを描画する一連の流れに、限定的に独自の関数を挿入することができます。
|
||||
Because of this, it is difficult to provide fully customizable hooks in `powershell`.
|
||||
ただし、Starship はプロンプトを描画する一連の流れに、限定的に独自の関数を挿入することができます。
|
||||
|
||||
`Invoke-Starship-PreCommand` という名前の関数を作成してください。
|
||||
|
||||
@@ -159,7 +200,9 @@ function Invoke-Starship-PreCommand {
|
||||
|
||||
## ウィンドウタイトルの変更
|
||||
|
||||
いくつかのシェルプロンプトはあなたのためにウィンドウのタイトルを自動的に変更します(例えば、カレントディレクトリを反映するために)。 特に Fish はデフォルトで変更を行います。 Starship はこれに対応しませんが、この機能を `bash`, `zsh`, `cmd`, `powershell` に追加することは簡単です。
|
||||
いくつかのシェルプロンプトはあなたのためにウィンドウのタイトルを自動的に変更します(例えば、カレントディレクトリを反映するために)。 特に Fish はデフォルトで変更を行います。 Starship はこれに対応しませんが、この機能を `bash`, `zsh`, `cmd`, `powershell` に追加することは簡単です。 特に Fish はデフォルトで変更を行います。
|
||||
Starship does not do this, but it's fairly straightforward to add this
|
||||
functionality to `bash`, `zsh`, `cmd` or `powershell`.
|
||||
|
||||
まず、ウィンドウのタイトルを変更する関数を定義してください( bash も zsh も同様に)
|
||||
|
||||
@@ -217,9 +260,11 @@ Invoke-Expression (&starship init powershell)
|
||||
|
||||
## 右プロンプトの有効化
|
||||
|
||||
シェルによっては、入力と同じ行にレンダリングされる右プロンプトをサポートしています。 Starship では `right_format` オプションを使って右プロンプトの内容を設定できます。 `format`で使用できるモジュールはすべて`right_format`でも使用できます。 変数`$all`には、`format`や`right_format`で明示的に使用されていないモジュールのみが格納されます。
|
||||
シェルによっては、入力と同じ行にレンダリングされる右プロンプトをサポートしています。 Starship can
|
||||
set the content of the right prompt using the `right_format` option. シェルによっては、入力と同じ行にレンダリングされる右プロンプトをサポートしています。 Starship では `right_format` オプションを使って右プロンプトの内容を設定できます。 `format`で使用できるモジュールはすべて`right_format`でも使用できます。 変数`$all`には、`format`や`right_format`で明示的に使用されていないモジュールのみが格納されます。 The `$all` variable will only contain modules
|
||||
not explicitly used in either `format` or `right_format`.
|
||||
|
||||
注意: 右プロンプトは入力の場所に続く単一の行です。 複数行プロンプトで入力行の上にあるモジュールを右寄せしたいときは、 [`fill` module](../config/#fill) を参照してください。
|
||||
注意: 右プロンプトは入力の場所に続く単一の行です。 注意: 右プロンプトは入力の場所に続く単一の行です。 複数行プロンプトで入力行の上にあるモジュールを右寄せしたいときは、 [`fill` module](../config/#fill) を参照してください。
|
||||
|
||||
`right_format` は現在、次のシェルでサポートされています: elvish, fish, zsh, xonsh, cmd, nushell, bash
|
||||
|
||||
@@ -243,11 +288,17 @@ right_format = """$all"""
|
||||
▶ starship on rprompt [!] is 📦 v0.57.0 via 🦀 v1.54.0 took 17s
|
||||
```
|
||||
|
||||
When using `zsh` (v5.0.5+), the shell adds a default trailing space to the right prompt. This can cause alignment issues specifically when using the Starship `$fill` module. To remove this gap, add the following to your `.zshrc`:
|
||||
|
||||
```zsh
|
||||
ZLE_RPROMPT_INDENT=0
|
||||
```
|
||||
|
||||
## 継続プロンプト (Continuation Prompt)
|
||||
|
||||
一部のシェルは、通常のプロンプトの他に継続プロンプトをサポートしています。 このプロンプトは、ユーザーが不完全な文 (単一の左括弧や引用符など) を確定したときに通常のプロンプトの代わりに表示されます。
|
||||
|
||||
Starship では、 `contination_prompt` オプションを使用して継続プロンプトを設定できます。 既定の継続プロンプトは `'[∙](bright-black) '` です。
|
||||
Starship では、 `contination_prompt` オプションを使用して継続プロンプトを設定できます。 既定の継続プロンプトは `'[∙](bright-black) '` です。 The default prompt is `'[∙](bright-black) '`.
|
||||
|
||||
注意: `contination_prompt` には変数を含まないそのまま文字列を設定する必要があります。
|
||||
|
||||
@@ -338,22 +389,22 @@ The `claude_model` module displays the current Claude model being used in the se
|
||||
|
||||
#### オプション
|
||||
|
||||
| オプション | デフォルト | 説明 |
|
||||
| --------------- | ---------------------------- | ----------------------------------------------------------------------------------------- |
|
||||
| `format` | `'[$symbol$model]($style) '` | module のフォーマットです。 |
|
||||
| `symbol` | `'🤖 '` | The symbol shown before the model name. |
|
||||
| `style` | `'bold blue'` | モジュールのスタイルです。 |
|
||||
| オプション | デフォルト | 説明 |
|
||||
| --------------- | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `format` | `'[$symbol$model]($style) '` | module のフォーマットです。 |
|
||||
| `symbol` | `'🤖 '` | The symbol shown before the model name. |
|
||||
| `style` | `'bold blue'` | モジュールのスタイルです。 |
|
||||
| `model_aliases` | `{}` | Map of model IDs or display names to shorter aliases. Checks ID first, then display name. |
|
||||
| `disabled` | `false` | Disables the `claude_model` module. |
|
||||
| `disabled` | `false` | Disables the `claude_model` module. |
|
||||
|
||||
#### 変数
|
||||
|
||||
| 変数 | 設定例 | 説明 |
|
||||
| --------- | ------------------- | ------------------------------------- |
|
||||
| model | `Claude 3.5 Sonnet` | The display name of the current model |
|
||||
| model_id | `claude-3-5-sonnet` | The model ID |
|
||||
| symbol | | オプション `symbol` の値をミラーする |
|
||||
| style\* | | オプション `style` の値をミラーする |
|
||||
| 変数 | 設定例 | 説明 |
|
||||
| ----------------------------- | ------------------- | ------------------------------------- |
|
||||
| model | `Claude 3.5 Sonnet` | The display name of the current model |
|
||||
| model_id | `claude-3-5-sonnet` | The model ID |
|
||||
| symbol | | オプション `symbol` の値をミラーする |
|
||||
| style\* | | オプション `style` の値をミラーする |
|
||||
|
||||
\*: この変数はスタイル文字列の一部としてのみ使用できます
|
||||
|
||||
@@ -383,9 +434,9 @@ The `claude_context` module displays context window usage as a percentage and vi
|
||||
|
||||
#### オプション
|
||||
|
||||
| オプション | デフォルト | 説明 |
|
||||
| ---------------------- | --------------------------------- | -------------------------------------------------- |
|
||||
| `format` | `'[$gauge $percentage]($style) '` | module のフォーマットです。 |
|
||||
| オプション | デフォルト | 説明 |
|
||||
| ---------------------- | --------------------------------- | ------------------------------------------------------------------ |
|
||||
| `format` | `'[$gauge $percentage]($style) '` | module のフォーマットです。 |
|
||||
| `symbol` | `''` | The symbol shown before the gauge. |
|
||||
| `gauge_width` | `5` | The width of the gauge in characters. |
|
||||
| `gauge_full_symbol` | `'█'` | The symbol used for filled segments of the gauge. |
|
||||
@@ -402,7 +453,7 @@ The `display` option is an array of objects that define thresholds and styles fo
|
||||
| ----------- | ------------ | ------------------------------------------------------------------------ |
|
||||
| `threshold` | `0.0` | The minimum context windows usage percentage to match this configuration |
|
||||
| `style` | `bold green` | The value of `style` if this display configuration is matched |
|
||||
| `hidden` | `false` | Hide this module if this the configuration is matched. |
|
||||
| `hidden` | `false` | Hide this module if this the configuration is matched. |
|
||||
|
||||
```toml
|
||||
[[claude_context.display]]
|
||||
@@ -424,19 +475,19 @@ style = "bold red"
|
||||
|
||||
#### 変数
|
||||
|
||||
| 変数 | 設定例 | 説明 |
|
||||
| ---------------------------- | ------- | ----------------------------------------------------- |
|
||||
| gauge | `██▒░░` | Visual representation of context usage |
|
||||
| percentage | `65%` | Context usage as a percentage |
|
||||
| input_tokens | `45.2k` | Total input tokens in conversation |
|
||||
| output_tokens | `12.3k` | Total output tokens in conversation |
|
||||
| curr_input_tokens | `5.1k` | Input tokens from most recent API call |
|
||||
| curr_output_tokens | `1.2k` | Output tokens from most recent API call |
|
||||
| 変数 | 設定例 | 説明 |
|
||||
| ----------------------------------------------------------------------------------------- | ------- | ----------------------------------------------------- |
|
||||
| gauge | `██▒░░` | Visual representation of context usage |
|
||||
| percentage | `65%` | Context usage as a percentage |
|
||||
| input_tokens | `45.2k` | Total input tokens in conversation |
|
||||
| output_tokens | `12.3k` | Total output tokens in conversation |
|
||||
| curr_input_tokens | `5.1k` | Input tokens from most recent API call |
|
||||
| curr_output_tokens | `1.2k` | Output tokens from most recent API call |
|
||||
| curr_cache_creation_tokens | `1.5k` | Cache creation tokens from most recent API call |
|
||||
| curr_cache_read_tokens | `23.4k` | Cache read tokens from most recent API call |
|
||||
| total_tokens | `200k` | Total context window size |
|
||||
| symbol | | オプション `symbol` の値をミラーする |
|
||||
| style\* | | Mirrors the style from the matching display threshold |
|
||||
| total_tokens | `200k` | Total context window size |
|
||||
| symbol | | オプション `symbol` の値をミラーする |
|
||||
| style\* | | Mirrors the style from the matching display threshold |
|
||||
|
||||
\*: この変数はスタイル文字列の一部としてのみ使用できます
|
||||
|
||||
@@ -502,10 +553,10 @@ The `claude_cost` module displays the total cost of the current Claude Code sess
|
||||
|
||||
#### オプション
|
||||
|
||||
| オプション | デフォルト | 説明 |
|
||||
| ---------- | ---------------------------------- | ----------------------------------- |
|
||||
| `format` | `'[$symbol(\\$$cost)]($style) '` | module のフォーマットです。 |
|
||||
| `symbol` | `'💰 '` | The symbol shown before the cost. |
|
||||
| オプション | デフォルト | 説明 |
|
||||
| ---------- | ---------------------------------- | --------------------------------------------------- |
|
||||
| `format` | `'[$symbol(\\$$cost)]($style) '` | module のフォーマットです。 |
|
||||
| `symbol` | `'💰 '` | The symbol shown before the cost. |
|
||||
| `display` | [この表の下を参照してください](#display-1) | Threshold and style configurations. |
|
||||
| `disabled` | `false` | Disables the `claude_cost` module. |
|
||||
|
||||
@@ -513,11 +564,11 @@ The `claude_cost` module displays the total cost of the current Claude Code sess
|
||||
|
||||
The `display` option is an array of objects that define cost thresholds and styles. The module uses the style from the highest matching threshold or hides the module if `hidden` is `true`.
|
||||
|
||||
| オプション | デフォルト | 説明 |
|
||||
| ----------- | ------------ | ------------------------------------------------------------- |
|
||||
| `threshold` | `0.0` | The minimum cost in USD to match this configuration |
|
||||
| `style` | `bold green` | The value of `style` if this display configuration is matched |
|
||||
| `hidden` | `false` | Hide this module if this configuration is matched. |
|
||||
| オプション | デフォルト | 説明 |
|
||||
| ----------- | ------------ | ------------------------------------------------------------------ |
|
||||
| `threshold` | `0.0` | The minimum cost in USD to match this configuration |
|
||||
| `style` | `bold green` | The value of `style` if this display configuration is matched |
|
||||
| `hidden` | `false` | Hide this module if this configuration is matched. |
|
||||
|
||||
**Default configuration:**
|
||||
|
||||
@@ -537,15 +588,15 @@ style = "bold red"
|
||||
|
||||
#### 変数
|
||||
|
||||
| 変数 | 設定例 | 説明 |
|
||||
| ------------- | -------- | ----------------------------------------------------- |
|
||||
| cost | `1.23` | Total session cost in USD (formatted to 2 decimals) |
|
||||
| duration | `1m 30s` | Total session duration |
|
||||
| api_duration | `45s` | Total API call duration |
|
||||
| lines_added | `1.2k` | Total lines of code added |
|
||||
| lines_removed | `500` | Total lines of code removed |
|
||||
| symbol | | オプション `symbol` の値をミラーする |
|
||||
| style\* | | Mirrors the style from the matching display threshold |
|
||||
| 変数 | 設定例 | 説明 |
|
||||
| ---------------------------------- | -------- | ---------------------------------------------------------------------- |
|
||||
| cost | `1.23` | Total session cost in USD (formatted to 2 decimals) |
|
||||
| duration | `1m 30s` | Total session duration |
|
||||
| api_duration | `45s` | Total API call duration |
|
||||
| lines_added | `1.2k` | Total lines of code added |
|
||||
| lines_removed | `500` | Total lines of code removed |
|
||||
| symbol | | オプション `symbol` の値をミラーする |
|
||||
| style\* | | Mirrors the style from the matching display threshold |
|
||||
|
||||
\*: この変数はスタイル文字列の一部としてのみ使用できます
|
||||
|
||||
@@ -578,7 +629,7 @@ format = "[$symbol$cost ($duration)]($style) "
|
||||
|
||||
## スタイルの設定
|
||||
|
||||
スタイル文字列は空白で区切られた単語のリストです。 大文字小文字を区別しません(例えば、 `bold` と`BoLd` は同じだとみなされます)。 それぞれ以下のいずれか一つが該当します。
|
||||
スタイル文字列は空白で区切られた単語のリストです。 大文字小文字を区別しません(例えば、 `bold` と`BoLd` は同じだとみなされます)。 それぞれ以下のいずれか一つが該当します。 The words are not case sensitive (i.e. `bold` and `BoLd` are considered the same string). それぞれ以下のいずれか一つが該当します。
|
||||
|
||||
- `bold`
|
||||
- `italic`
|
||||
@@ -593,19 +644,23 @@ format = "[$symbol$cost ($duration)]($style) "
|
||||
- `<color>`
|
||||
- `none`
|
||||
|
||||
ここで、 `<color>` は色を指定します(以下で述べます)。 現在 `fg:<color>` と `<color>` は同様の動作ですが、将来変更される可能性があります。 `<color>` can also be set to `prev_fg` or `prev_bg` which evaluates to the previous item's foreground or background color respectively if available or `none` otherwise. `inverted` は背景と前景の色を交換します。 文字列中の単語の順序は関係ありません。
|
||||
where `<color>` is a color specifier (discussed below). `fg:<color>` and `<color>` currently do the same thing, though this may change in the future.
|
||||
`<color>` can also be set to `prev_fg` or `prev_bg` which evaluates to the previous item's foreground or background color respectively if available or `none` otherwise.
|
||||
`inverted` swaps the background and foreground colors. 文字列中の単語の順序は関係ありません。
|
||||
|
||||
`none` トークンは、文字列中の`bg:` 指定子の一部でない場合、他のすべてのトークンをオーバーライドします。そのため、たとえば、`fg:red none fg:blue` と指定した場合、スタイルなしの文字列が作られます。 `bg:none` は背景色をデフォルトの色にセットするので、`fg:red bg:none` は `red` や `fg:red` と同じ意味になり、`bg:green fg:red bg:none` も `fg:red` や `red` と同じ意味になります。 将来 `none` を他の単語と一緒に使用することはエラーになるかもしれません。
|
||||
`none` トークンは、文字列中の`bg:` 指定子の一部でない場合、他のすべてのトークンをオーバーライドします。そのため、たとえば、`fg:red none fg:blue` と指定した場合、スタイルなしの文字列が作られます。 `bg:none` は背景色をデフォルトの色にセットするので、`fg:red bg:none` は `red` や `fg:red` と同じ意味になり、`bg:green fg:red bg:none` も `fg:red` や `red` と同じ意味になります。 将来 `none` を他の単語と一緒に使用することはエラーになるかもしれません。 `bg:none` sets the background to the default color so `fg:red bg:none` is equivalent to `red` or `fg:red` and `bg:green fg:red bg:none` is also equivalent to `fg:red` or `red`. It may become an error to use `none` in conjunction with other tokens in the future.
|
||||
|
||||
色は以下のいずれか1つを指定できます。
|
||||
|
||||
- 標準的なターミナルカラーの `black`、 `red`、 `green`、 `blue`、 `yellow`、 `purple`、 `cyan`、 `white`。 必要に応じて、より明るい色を得るために `bright-` を前につけることができます。(例えば、 `bright-white` )
|
||||
- `#` に続く16進数。 [RGB の16進数カラーコード](https://www.w3schools.com/colors/colors_hexadecimal.asp)を表します。
|
||||
- 0-255 までの間の数字。 [8-bit ANSI カラーコード](https://i.stack.imgur.com/KTSQa.png) を表します。
|
||||
- One of the standard terminal colors: `black`, `red`, `green`, `blue`,
|
||||
`yellow`, `purple`, `cyan`, `white`. You can optionally prefix these
|
||||
with `bright-` to get the bright version (e.g. `bright-white`).
|
||||
- A `#` followed by a six-digit hexadecimal number. `#` に続く16進数。 [RGB の16進数カラーコード](https://www.w3schools.com/colors/colors_hexadecimal.asp)を表します。
|
||||
- 0-255 までの間の数字。 0-255 までの間の数字。 [8-bit ANSI カラーコード](https://i.stack.imgur.com/KTSQa.png) を表します。
|
||||
|
||||
複数の色が文字色/背景色に指定された際には、最後の指定が優先して選ばれます。
|
||||
|
||||
すべてのスタイル文字列がすべての端末で正しく表示できるわけではありません。 特に、端末の変な動作として以下のようなものが知られています。
|
||||
すべてのスタイル文字列がすべての端末で正しく表示できるわけではありません。 特に、端末の変な動作として以下のようなものが知られています。 特に、端末の変な動作として以下のようなものが知られています。
|
||||
|
||||
- 多くの端末はデフォルトで `blink` のサポートを無効にしています。
|
||||
- `hidden` は [iTerm ではサポートされていません](https://gitlab.com/gnachman/iterm2/-/issues/4564)。
|
||||
|
||||
Reference in New Issue
Block a user