mengelbrecht / slimline Goto Github PK
View Code? Open in Web Editor NEWMinimal, customizable, fast and elegant ZSH prompt
License: MIT License
Minimal, customizable, fast and elegant ZSH prompt
License: MIT License
Disclaimer: I know that this github's section is not a support line, so no hard feelings if you decide to close this - but every help would be appreciated ;-)
So, I have those two simple scripts:
`slimline::section::k8s_context::precmd() {
unset slimline_section_k8s_context_output
}
slimline::section::k8s_context::async_task() {
kubectl config current-context
}
slimline::section::k8s_context::async_task_complete() {
slimline_section_k8s_context_output=$2
}
slimline::section::k8s_context::render() {
[[ -z "${slimline_section_k8s_context_output}" ]] && return
slimline::utils::expand "k8s_context" "%F{blue}\U2388 |output|%f"
"output" "${slimline_section_k8s_context_output}"
}`
and
`slimline::section::k8s_namespace::precmd() {
unset slimline_section_k8s_namespace_output
}
slimline::section::k8s_namespace::async_task() {
kubectl config view --minify --output 'jsonpath={..namespace}'
}
slimline::section::k8s_namespace::async_task_complete() {
slimline_section_k8s_namespace_output=$2
}
slimline::section::k8s_namespace::render() {
[[ -z "${slimline_section_k8s_namespace_output}" ]] && return
slimline::utils::expand "k8s_namespace" "ns:%F{blue}|output|%f"
"output" "${slimline_section_k8s_namespace_output}"
}`
The first one works good, but when I use the second one, my display goes crazy - after every command, it's output is there properly, but after a very short moment (less than a second) the last line of output is deleted, and in it's place there is my slimline prompt. What am I doing wrong here? I've tried to put everything in one section, but I don't know, how ;-)
Hey,
I have set up slightly modified version of urbainvaes/fzf-marks. Problem I have is after using FZF to change into directory gitline part of slimline does not get refreshed. So, if I am arriving from another git repository I am still presented information for old repository until I execute any command. It also happens when I arrive from non git repository directory, in which case I don't get gitline part at all.
Is there anything you can see that might be causing gitline not to be async'ed upon cd
invoked in this line?
Thanks!
Hi there,
I have noticed that my prompt gets printed couple of times (three) on all newly opened terminal windows.
I have pinned it down to zle reset-prompt
command, which I call once from my zsh configuration and slimline does once too.
My code to put vi-mode indicator nicely in prompt rather than as separate section:
function zle-line-init-vimode zle-keymap-select {
psvar[1]="${${KEYMAP/vicmd/❮}/(main|viins)/❯}"
zle .reset-prompt
}
zle -N zle-keymap-select
# Enables terminal application mode and updates editor information
function zle-line-init {
zle-line-init-vimode
(( $+terminfo[smkx] )) && echoti smkx
}
zle -N zle-line-init
# Disables terminal application mode and updates editor information
function zle-line-finish {
(( $+terminfo[rmkx] )) && echoti rmkx
}
zle -N zle-line-finish
slimline calls prompt-reset
here https://github.com/mgee/slimline/blob/master/slimline.zsh#L32
It also reprints prompt when I change between insert and command modes.
What is interesting is that it does not do that when there is text printed above prompt (and since I use zsh -i
as login shell to get rid of Last Login: <date>
output) there is no text above prompt when opening new terminal window. Please note that touching ~/.hushlogin and removing -i from zsh invocation also causes multiple prompts line. Removing -i
from zsh invocation does sole the problem, but is not ideal.
Can you think of any way around my problem? Thanks.
I regularly start seeing the error message
async_job:zpty:12: no such pty command: prompt_slimline
after working in my shell for a while. The slimline theme works fine, but then it suddenly malfunctions in that way. I have no clue why.
I seem to be able to reproduce that issue more regularly if I set
SLIMLINE_ENABLE_ASYNC_AUTOLOAD=0
and install async
explicitly via
zplug "mafredri/zsh-async", from:"github", use:"async.zsh"
before I initialize slimline. But it happens with autoloading enabled, too, only less frequently. Can you make any sense of this?
Hey Markus, was thinking recently about some inconsistency in a way slimline displays data. pythonenv would end up in brackets in RPROMPT, AWS profile would be 'nude' (without brackets) in left prompt.
I was wondering whether some order and possibly configuration options for 'sections' could be introduced.
Mainly this is because I would like to see some extra, optional features like kubernetes cluster information. (Since it involves external command call it would be great if it could be done asynchronously like git.)
Also, would be amazing if sections could be configurable, order and position (left or right prompt) as well as separator between them.
Another thing is:
prompt_slimline_set_prompt uses function calls to retrieve sections while
prompt_slimline_set_rprompt has all/some code embedded.
I could see all if statements going into their relevant functions since calls are very inexpensive.
It's all really to clean things up a bit to allow easier sections development.
What do you think?
Hey,
would you consider adding merge, rebase, cherry-picking and bisect state information to gitline.py?
Example implementation can be found here.
Thanks.
I've been using slimline for a while now and I feel the only piece that's missing for me is a vi modal indicator.
Could such a feature be added to the roadmap?
Thanks,
Sonnius
For some reason, the cursor moves one space behind when entering some git
repositories, which after some time it makes the line unusable
See: https://asciinema.org/a/zrMQ55rA3hM16xbue6DdlA3Ym
Any thoughts on how to fix this?
Hi.
This is more like feature request.
I like simplicity and clean look of slimline, but I'm not so used to have right prompt. The problem is, after putting everything I (we?) need to left prompt, it ends in like 3/4 of terminal space ;-)
So I was wondering, is it possible to add section that will simply create newline? I've tried with simple:
slimline::section::newline::render() { printf "\n" }
but it doesn't work :(
Some very light virtualenv integration would be nice, is there any way to allow virtualenvs to display itself like in other prompts?
After I activate my virtualenv and go to the project folder I get this:
Exception in thread Thread-4: Traceback (most recent call last): File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 864, in run self._target(*self._args, **self._kwargs) File "/Users/-----/-------/-------/-----/slimline/gitline/gitline.py", line 139, in _stashes self.repo.stashes = len(filter(bool, execute(['git', 'stash', 'list']).splitlines())) TypeError: object of type 'filter' has no len()
I'm using slimline via zplug
on a variety of Linux machines, and with commit b63fa88 everything works fine. After updating to de5183f, however, slimline no longer works. The function slimline_setup
starts up, but never terminates. I have tried to figure out what the code is doing, but I wasn't able to. I'm not sure how the slimline plugin interacts with zplug exactly. Anyhow, reverting the async
update fixed slimline on all my accounts.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.