Estou executando o Powerline com peixes do tmux. Tentei configurar um prompt de shell de várias linhas e recebi o seguinte comportamento no fish e no zsh:
Ainda não tentei reproduzir em uma VM, portanto, se houver algo óbvio que estou fazendo de errado, indique-o.
Se ajudar, aqui está o resultado de env $POWERLINE_COMMAND shell right | xxd
:
00000000: 1b5b 306d .[0m
E aqui estão os avisos de peixes:
$ 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
mínimo:
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
mínimo:
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
Casca: fish v2.3.1
, zsh 5.2
Python: 3.5.2
SO: Manjaro (derivado do 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
Está faltando o segmento de preenchimento. Os segmentos direitos não são alinhados à direita por design, eles devem ser alinhados por segmentos de preenchimento. Exemplos podem ser vistos na configuração do Vim.
Olá @ ZyX-I
Como posso fazer um segmento de preenchimento? Existe um segmento específico que se comporta como um preenchimento? E como posso fazer com que pareça que o significado de "transparente" parece que não há nada escrito nele
@Javiergg Os exemplos de segmentos de preenchimento estão em temas do Vim. Não existe a opção “transparente”, você precisa criar um grupo de destaque que tenha o mesmo fundo que o resto do terminal e usá-lo para o preenchimento.
Encontrei-os. Muito obrigado @ ZyX-I
Uma pergunta, embora não haja uma cor "transparente", seria possível "detectar" a cor de fundo do terminal ou usá-la como uma variável de sistema?
@Javiergg Essa opção não existe. Você pode tentar usar a cor 0, se não estou enganando, isso deve funcionar como você precisa até que você tente habilitar a coloração de 24 bits.
Apenas uma nota para googlers como eu.
Exemplo de segmento de preenchimento:
{
"type": "string",
"highlight_groups": ["background"],
"draw_soft_divider": false,
"draw_hard_divider": false,
"width": "auto"
}
Olá a todos, e obrigado por esta ideia muito boa de powerline.
É possível ver um segmento especial para env de linguagem? como ruby e rvm, python e django, etc ... talvez um ícone para ruby / python / perl / other -version e a posição rvm para trilhos ...
acho que deveria haver uma maneira de fazer isso, e talvez já exista um segmento para mostrar isso.
você poderia me interromper por favor? (não estou tão longe de ter o melhor shell zsh-powerline no meu sistema operacional archlinux, estou muito feliz)
Comentários muito úteis
Apenas uma nota para googlers como eu.
Exemplo de segmento de preenchimento: