eendroroy / alien-minimal Goto Github PK
View Code? Open in Web Editor NEWAn asynchronous minimal zsh prompt
License: MIT License
An asynchronous minimal zsh prompt
License: MIT License
I'm submitting a ...
Do you want to request a feature or report a bug?
Report a Bug
What is the current behavior?
Vi indicator does not update as intended.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
Simply enable Vi mode and toggle between insert mode and normal mode.
What is the expected behavior?
That the indicator update properly.
What is the motivation / use case for changing the behavior?
Expanding our prompt to support vi mode users.
Please tell us about your environment:
zle-line-init()
and zle-keymap-select()
both trigger a method which updates AM_VI_MODE_IND
. We then trigger a reset-prompt
which will cause the prompt to "re-render".
I believe the issue with the Vi indicator is that this reset prompt doesn't trigger all of our other methods, rather it just uses the current RPROMPT
again. For this reason, I believe we need to change echo -ne "${AM_VI_MODE_IND}"
to echo -ne '${AM_VI_MODE_IND}
.
This way, your RPROMPT
variable will be
%F{8}[%f%F{2}PY:2.7.10%f%F{8}|%f%F{1}RB:2.3.7%f%F{8}|%f%F{2}⬡ 10.16.3%f%F{8}]%f %F{1}G:%f%B%F{10}min%f%b %F{6}[4D]%f %F{14}227998f%f %F{1}⭑%f ${AM_VI_MODE_IND}
instead of
%F{8}[%f%F{2}PY:2.7.10%f%F{8}|%f%F{1}RB:2.3.7%f%F{8}|%f%F{2}⬡ 10.16.3%f%F{8}]%f %F{1}G:%f%B%F{10}min%f%b %F{6}[4D]%f %F{14}227998f%f %F{1}⭑%f
This, I believe, is what allows the Vi indicator to work properly 😉
I'm submitting a ...
feature request
Do you want to request a feature or report a bug?
feature
What is the current behavior?
prompt and command output don't have a blank line in between them
What is the expected behavior?
have it show a blank line, like it does in the non-minimal alien
What is the motivation / use case for changing the behavior?
I feel it would look cleaner
Please tell us about your environment:
I'm submitting a ...
Do you want to request a feature or report a bug?
bug
What is the current behavior?
right prompt is never show on a specific machine
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
Use my dotfiles https://gitlab.com/gnumoksha/dotfiles
What is the expected behavior?
alien-minimal show a right prompt
What is the motivation / use case for changing the behavior?
none
Please tell us about your environment:
none
zsh 5.7.1 (x86_64-debian-linux-gnu)
I'm submitting a ...
Do you want to request a feature or report a bug?
Report a bug
What is the current behavior?
When I installed this today on a new system using Antigen, it is outputting all environment variables in the prompt. I see that the theme was updated yesterday. Possibly a bug? I even changed to directly using the git repo and it still has the bug.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
My prompt looks like this: https://gist.github.com/sibblegp/dc6f656123e0ce1ef6e7d45b63a0bade
What is the expected behavior?
Not to print all environment variables.
What is the motivation / use case for changing the behavior?
Have it work like it usually does.
Please tell us about your environment:
I'm submitting a ...
Maybe I should post it on your library promptlib-zsh instead, more detail on that further down the page.
I am currently implementing some simple features on my fork of the project and I found what I would qualify as a design flaw where the single responsibility principle isn't respected, which makes customization harder:
Most of the prompt parts have customizable colors, symbols, and we can even choose, for some of them, whether or not they should appear. So far so good BUT:
You are using your helper library promptlib-zsh which handles all the little tasks such as determining versions, git branches, etc...
The issue I encountered in alien-minimal
is that I don't have much control over the "branch status" part (colors, icons ...) which is generated by am_git_dirty. Of course we can use the environment variables as specified in the documentation but I, developer, expected to be able to tweak every aspect of my prompt, including separators, just by editing this project's code. The current environment variables do not offer enough options to my taste.
The root of the issue is that plib_git_dirty is responsible for getting the status of the git branche ... but also the formatting, which is where I think it breaks the single responibilty principle. Most of the other function only return raw data, but not plib_git_dirty
, it does more than that.
What that means for me is that if I want to modify the way branch status is displayed, e.g.
I simply can't do it without ugly, heavy, complicated parsing of plib_git_dirty
's returned value (and even then I couldn't get the number of modified files for instance) when it should have just returned data.
I could also fork promptlib-zsh as well, but I would be forking and tweaking two projects for one result because one of the two does a little of both tasks.
I think the project is well structured and the objective was obviously to have it very modular but this particular implementation is not.
What I suggest is to move everything format-related from plib_git_dirty
to alien-minimal
. As a "theme plugin" am should handle ALL formatting.
If you agree with these "requested changes" as I would call it, I could make the two PRs. Tbh I'm just done with writing this ... and I just realized I should have coded it in the first place ... because I'll do it anyway.
When you set AM_ERROR_ON_START=0 the prompt shows the short path to the current directory when the exit code of the program previously ran is 0.
>> ~/dotfiles % export AM_ERROR_ON_START_TAG=0
>> dotfiles % false
>> ~/dotfiles % 1 true
>> dotfiles %
I'm submitting a ...
Do you want to request a feature or report a bug?
Bug.
What is the current behavior?
Astronomically slow responses.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
Simply sshfs mount, change directories into the mount folder, then try running a command like ls
(try it about 2 or 3 times) and it will wait about 60 seconds before replying
What is the expected behavior?
To reply almost instantly or relative to its computation time needed.
Please tell us about your environment:
Arch linux x86 Intel, 16GB RAM, 3.1 Ghz
I'm submitting a ...
Do you want to request a feature or report a bug?
This is more along the lines of a support request or a bug report.
VIM prompt and VERSIONS prompt are not updating properly.
I have AM_ENABLED_VI_PROMPT=1
, AM_VERSIONS_PROMPT=(PYTHON RUBY NODE)
, AM_KEEP_PROMPT=1
, and AM_SEGMENT_UPDATE=0
. Calling pyenv shell 2.7.15
does not update the python version in the prompt. Hitting <ESC>
does not properly indicate the vi mode.
Versions and Vi prompts should update accordingly.
Ensuring that users are kept up to date with the latest information.
I've actually been meaning to talk with you specifically about the Vi stuff, but in pulling down a recent update it seems the versions prompt is no longer updating either and if we focus on that I may better understand how to submit a PR for the Vi stuff.
So focusing on version prompts, I think what is happening here is that shells are being expanded too early? But at the same time, I don't want to remove the async design...
zsh's precmd
is executed before every prompt. If I insert a echo -n $(pyenv version)
here, it always displays the correct and most up to date version.
Inside of precmd
, we call am_async_r_prompt
. If I insert an echo -n $(pyenv version)
here, it always displays the correct and most up to date version.
Inside of am_r_prompt
, we call am_r_prompt_complete
. This is the tricky thing... if I insert an echo -n $(pyenv version)
here, I will always get the version that python was when the shell started. It does not stay up to date. (Almost as if the string is evaluated once at startup and then reused for the remainder of the shell session.)
One easy fix, is to replace the double quotes in am_r_prompt_complete
to be single quotes. This fixes version prompts for me but also results in RPROMPT calling functions in I believe a very non-async fashion...
So, what is going on here? I would expect that when I debug printed the python version in am_r_prompt_complete
that it would always be up to date. It does not seem to matter if AM_KEEP_PROMPT
or AM_SEGMENT_UPDATE
is set or not.
Describe the bug
When I enable the theme, zsh starts to throw:
(eval):1: bad assignment
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No errors thrown
Environment:
Additional context
Not sure what causing it, and no more ideas how to debug. When I used other themes, everything worked. When I switch back to old one, everything works.
I installed the theme with:
git clone --recurse-submodules https://github.com/eendroroy/alien-minimal.git ${ZSH_CUSTOM}/themes/alien-minimal
I cleaned the .zshrc from everything, except:
export ZSH="/home/user/.oh-my-zsh"
ZSH_THEME="alien-minimal/alien-minimal"
source $ZSH/oh-my-zsh.sh
and it still unfortunately happen.
I expect it to be layer 8 problem, i'm just out of ideas how to debug it.
I'm submitting a ...
feature request
What is the current behavior?
There is no way to tell if one is in insert or command mode
What is the expected behavior?
there should be a visible way to tell if i'm inserting commands into the prompt, or editing them in command mode
What is the motivation / use case for changing the behavior?
Having vim mode on the shell is great, especially if you need to edit long commands and things like that, it can make motion fast too.
Please tell us about your environment:
VIM_PROMPT=">"
PROMPT='%(?.%B%F{green}.%B%F{red}>%B%F{green})${VIM_PROMPT}%b%f '
prompt_pure_update_vim_prompt() {
zle || {
print "error: pure_update_vim_prompt must be called when zle is active"
return 1
}
VIM_PROMPT=${${KEYMAP/vicmd/<}/(main|viins)/>}
zle .reset-prompt
}
function zle-line-init zle-keymap-select {
prompt_pure_update_vim_prompt
}
export KEYTIMEOUT=1
zle -N zle-line-init
zle -N zle-keymap-select
This way your prompt would look like
> ~ really-long-command-here
in insert mode, and like this
< ~ really-long-command-here
in command mode.
I feel doing it this way would be in keeping with the minimalness of the theme while adding a nice feature.
But of course, i'm not married to this approach or anything like that.
Hey, friend. Still loving the theme. I was wondering if you had this issue that I'm having. It may have came about with the variables from my last issue.
The directory portion of my prompt will disappear after x amount of time and will reappear next time I enter a command. I never notice if it is caused by something weird happening with my terminal or if it just randomly switches. I'll attach a screenshot for example.
Here's the info that get's loaded from my .zshrc
file
PROMPT_START_TAG='→ '
PROMPT_END_TAG=' $'
PROMPT_START_TAG_COLOR=71
PROMPT_END_TAG_COLOR=71
source ~/.oh-my-zsh/antigen.zsh
antigen use oh-my-zsh
...antigen bundle random stuff
antigen bundle https://github.com/eendroroy/alien-minimal.git
antigen apply
It's not a big deal. It's been happening for a while and hasn't disrupted me, just figured I'd post this to see if you had a simple solution! Thanks!
I'm submitting a ...
Do you want to request a feature or report a bug?
bug
when I first start a terminal/item2 I get:
module: 'crystal' not found
module: 'go' not found
module: 'php' not found
start terminal/iterm2
not showing:
module: 'crystal' not found
module: 'go' not found
module: 'php' not found
n/a
my environment:
export AM_SHOW_PROCESS_TIME=0 # hide
export PROMPT_END_TAG=' §'
#export USE_NERD_FONT=1
export AM_VERSIONS_PROMPT=(RUBY PYTHON)
export AM_SHOW_FULL_DIR=0
export AM_UPDATE_L_PROMPT=0
#export AM_THEME=MONO_BRIGHT
unset AM_THEME
export AM_JAVA_SYM='J:' # JAVA Version Symbol
export AM_PY_SYM='P:' # Python Version Symbol
export AM_RB_SYM='R:' # Ruby Version Symbol
export AM_GIT_SYM=G # Git Symbol
export AM_HG_SYM=M # Mercurial Symbol
export AM_SSH_SYM=[S] # SSH Indicator Symbol
export PLIB_GIT_ADD_SYM=+ # Git New Tracked File Symbol
export PLIB_GIT_DEL_SYM=- # Git Deleted File Symbol
export PLIB_GIT_MOD_SYM=⭑ # Git Modified File Symbol
export PLIB_GIT_NEW_SYM=? # Git New Untracked File Symbol
export PLIB_GIT_PUSH_SYM=↑ # Git Unpushed Commit Symbol
export PLIB_GIT_PULL_SYM=↓ # Git New Commit Symbol
I'm submitting a ...
Do you want to request a feature or report a bug?
What is the current behavior?
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
go to a git repo with no commit
fatal: your current branch 'master' does not have any commits yet
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
What is the expected behavior?
There should be no error.
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
Is your feature request related to a problem? Please describe.
If I have 2 terminal windows opened and in the same git folder, If I switch to different branch in one, the other one does not auto update in the background, still showing the previous branch.
Describe the solution you'd like
It would be good if the prompt could be updated in background, so if I have 2 windows with terminal in the same git repo, and I change branch in one, the other would refresh itself showing new branch. This would also be useful when you switch branch in some other software, like vscode.
Describe the bug
Using oh my zsh nvm plugin, nvm and alien-minimal.
To Reproduce
Steps to reproduce the behavior:
~ (i) export AM_VERSIONS_PROMPT=(NODE NODE_S)
[⬡ 11.15.0|⬡ 11.15]
~ (i) nvm use 9
Now using node v9.11.2 (npm v5.6.0)
[⬡ 11.15.0|⬡ 11.15]
~ (i)
Expected behavior
I expect the right node version.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment:
Additional context
When launching echo -ne "%F{$AM_NODE_COLOR}${AM_NODE_SYM}$(plib_node_version)%f"
I got the right result
As the title says, an option to color the start tag red if the exit code is not null and blue else, leaving the current directory color unchanged, would be nice.
Also I'd like to have an option to show the full path instead of only the directory between start and end tag.
I love the theme :) super simple, just what I wanted.
I was trying to mess with it a little to add an arrow and a dollar sign(I know, making it less simple which I just said I wanted ¯_(ツ)_/¯)
Basically I want it to be → my-dir $ some-command
instead of my-dir some-command
The problem is when I add characters to the prompt the alignment gets all messed up. Any tips on how to do this from a fork of your repo?
Thanks!
I'm submitting a ...
Do you want to request a feature or report a bug?
What is the current behavior?
whenever I hit Enter, the right prompt disappear while waiting for the async update
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
What is the expected behavior?
it should show the previous status while waiting for git status update. when the new status available, it could replace the old one.
What is the motivation / use case for changing the behavior?
Better UX
Please tell us about your environment:
Describe the bug
So I followed the installation steps and created the ~/.amrc file however the shell is not adapting the theme
The title says it. The change to the short directory is noticable on my Odroid C2, but on my desktop it seems like it only prints the short directory.
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.