tmuxの魚でPowerlineを実行しています。 複数行のシェルプロンプトを設定しようとすると、fishとzshの両方で次の動作が発生しました。
私はまだVMで再現しようとはしていませんので、明らかに間違っていることがある場合は、それを指摘してください。
それが役立つ場合は、 env $POWERLINE_COMMAND shell right | xxd
の出力を次に示します。
00000000: 1b5b 306d .[0m
そしてここに魚のプロンプトがあります:
$ type fish_prompt
fish_prompt is a function with definition
function fish_prompt
env $POWERLINE_COMMAND shell aboveleft --last-exit-code=$status --last-pipe-status=$status --jobnum=(jobs -p | wc -l) --renderer-arg=client_id=12917 --width=$_POWERLINE_COLUMNS --renderer-arg=mode=$fish_bind_mode --renderer-arg=default_mode=$_POWERLINE_DEFAULT_MODE
end
$ type fish_right_prompt
fish_right_prompt is a function with definition
function fish_right_prompt
env $POWERLINE_COMMAND shell right --last-exit-code=$status --last-pipe-status=$status --jobnum=(jobs -p | wc -l) --renderer-arg=client_id=12917 --width=$_POWERLINE_COLUMNS --renderer-arg=mode=$fish_bind_mode --renderer-arg=default_mode=$_POWERLINE_DEFAULT_MODE
echo -n " "
end
~/.config/powerline/themes/shell/default.json
:
{
"segments": {
"above": [
{
"left": [
{
"function": "powerline.segments.common.net.hostname",
"priority": 10
},
{
"function": "powerline.segments.common.env.user",
"priority": 30
},
{
"function": "powerline.segments.shell.cwd",
"priority": 10
},
{
"function": "powerline.segments.shell.jobnum",
"priority": 20
}
],
"right": [
{
"function": "powerline_gitstatus.gitstatus",
"priority": 40
},
{
"function": "powerline.segments.common.time.date",
"name": "time",
"args": {
"format": "%H:%M:%S",
"istime": true
}
},
{
"function": "powerline.segments.shell.last_pipe_status",
"priority": 10
},
{
"function": "powerline.segments.common.env.virtualenv",
"priority": 50
}
]
}
],
"left": [
{
"function": "powerline.segments.shell.mode"
},
{
"function": "powerline.segments.shell.last_pipe_status",
"priority": 10
},
{
"function": "powerline.segments.common.time.date",
"args": {
"format": "$"
}
}
],
"right": [
]
}
}
~/.tmux.conf
:
set -g default-terminal "screen-256color"
POWERLINE_CONFIG_PATHS="$HOME/.config/powerline"
run-shell "powerline-daemon -q"
source "/usr/lib/python3.5/site-packages/powerline/bindings/tmux/powerline.conf"
最小限のconfig.fish
:
set -gx POWERLINE_CONFIG_PATHS "$HOME/.config/powerline"
set fish_function_path $fish_function_path "/usr/lib/python3.5/site-packages/powerline/bindings/fish"
powerline-setup
source /usr/share/fish/functions/fzf.fish
最小限の.zshrc
:
HYPHEN_INSENSITIVE="true"
DISABLE_AUTO_UPDATE="true"
if [[ -r /usr/lib/python3.5/site-packages/powerline/bindings/zsh/powerline.zsh ]]; then
source /usr/lib/python3.5/site-packages/powerline/bindings/zsh/powerline.zsh
fi
シェル: fish v2.3.1
、 zsh 5.2
Python: 3.5.2
OS:Manjaro(Arch Linux派生物)
$ pip show powerline-status
---
Metadata-Version: 1.1
Name: powerline-status
Version: 2.4
Summary: The ultimate statusline/prompt utility.
Home-page: https://github.com/powerline/powerline
Author: Kim Silkebaekken
Author-email: [email protected]
License: MIT
Location: /usr/lib/python3.5/site-packages
Requires:
Classifiers:
Development Status :: 5 - Production/Stable
Environment :: Console
Environment :: Plugins
Intended Audience :: End Users/Desktop
License :: OSI Approved :: MIT License
Natural Language :: English
Operating System :: Microsoft :: Windows
Operating System :: POSIX
Programming Language :: Python :: 2.6
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3.2
Programming Language :: Python :: 3.3
Programming Language :: Python :: 3.4
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy
フィラーセグメントがありません。 右側のセグメントは、設計上、右側に配置されません。フィラーセグメントによって配置されることになっています。 例はVim構成で見ることができます。
こんにちは@ ZyX-I
フィラーセグメントを作成するにはどうすればよいですか? フィラーとして機能する特定のセグメントはありますか? そして、どうすればそれを「透明な」意味のように見せることができますか?何も書かれていないように見えます
@Javierggフィラーセグメントの例はVimテーマにあります。 「透過的」オプションはありません。端末の他の部分と同じ背景を持つハイライトグループを作成し、それをフィラーに使用する必要があります。
それらを見つけました。 どうもありがとう@ ZyX-I
「透明な」色はありませんが、端末の背景色を「検出」したり、システム変数として使用したりすることは可能でしょうか。
@Javierggそのようなオプションはありません。 カラー0を試してみてください。間違いがなければ、24ビットカラーリングを有効にするまで、これは必要に応じて機能するはずです。
私のようなグーグルへのメモ。
フィラーセグメントの例:
{
"type": "string",
"highlight_groups": ["background"],
"draw_soft_divider": false,
"draw_hard_divider": false,
"width": "auto"
}
みなさん、こんにちは。このとても素敵な電力線のアイデアに感謝します。
言語envの特別なセグメントを表示することは可能ですか? rubyとrvm、pythonとdjangoなどのように...おそらくruby / python / perl / other-versionのアイコンとrailsのrvm位置...
私はそれを行う方法があるべきだと思います、そして多分これを示すためにすでに存在するセグメントがあります。
その上で私を半分にしてくれませんか? (私は私のarchlinux OSで最高のzsh-powerlineシェルを持っていることは今のところありません、私はとても幸せです)
最も参考になるコメント
私のようなグーグルへのメモ。
フィラーセグメントの例: