Estoy ejecutando Powerline con pescado de tmux. Intenté configurar un indicador de shell de varias líneas y recibí el siguiente comportamiento tanto en fish como en zsh:
Todavía no he intentado reproducir en una máquina virtual, así que si hay algo obvio que estoy haciendo mal, por favor, indíquelo.
Si ayuda, aquí está la salida de env $POWERLINE_COMMAND shell right | xxd
:
00000000: 1b5b 306d .[0m
Y aquí están las indicaciones de los peces:
$ 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"
Mínimo 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
Mínimo .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
Concha: fish v2.3.1
, zsh 5.2
Python: 3.5.2
SO: Manjaro (derivado de 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
Falta el segmento de relleno. Los segmentos derechos no se alinean a la derecha por diseño, se supone que deben estar alineados por segmentos de relleno. Se pueden ver ejemplos en la configuración de Vim.
Hola @ ZyX-I
¿Cómo puedo hacer un segmento de relleno? ¿Existe algún segmento específico que se comporte como relleno? ¿Y cómo puedo hacer que parezca que el significado "transparente" parezca que no hay nada escrito en él?
@Javiergg Los ejemplos de segmentos de relleno están en temas de Vim. No hay una opción "transparente", necesita crear un grupo de resaltado que tenga el mismo fondo que el resto del terminal y usarlo para el relleno.
Los encontré. Muchas gracias @ ZyX-I
Una pregunta, aunque no hay un color "transparente", ¿sería posible "detectar" el color de fondo del terminal o usarlo como una variable de sistema?
@Javiergg No existe tal opción. Puede intentar usar el color 0, si no me equivoco, esto debería funcionar como necesita hasta que intente habilitar la coloración de 24 bits.
Solo una nota para los usuarios de Google como yo.
Ejemplo de segmento de relleno:
{
"type": "string",
"highlight_groups": ["background"],
"draw_soft_divider": false,
"draw_hard_divider": false,
"width": "auto"
}
Hola a todos, y gracias por esta muy buena idea de powerline.
¿Es posible ver un segmento especial para lenguaje env? como ruby y rvm, python y django, etc ... tal vez un ícono para ruby / python / perl / other -version y la posición rvm para rieles ...
Creo que debería tener una forma de hacerlo, y tal vez ya exista un segmento para mostrar esto.
¿Podrías detenerme en eso, por favor? (no estoy tan lejos de tener el mejor shell zsh-powerline en mi sistema operativo archlinux, estoy muy feliz)
Comentario más útil
Solo una nota para los usuarios de Google como yo.
Ejemplo de segmento de relleno: