vadviktor / bullettrain-go-core Goto Github PK
View Code? Open in Web Editor NEWSingle executable shell prompt builder with very low latency.
License: MIT License
Single executable shell prompt builder with very low latency.
License: MIT License
It would be nice if you had glide or something similar setup for development to pull in dependencies. It would make it a lot easier to get a development environment going.
Right now it is not too clear for me what Go construct to use to keep the defined segments in order, that is capable of reading the ordering also from a list of strings. Like in the original ZSH shell script version:
BULLETTRAIN_PROMPT_ORDER=(
time
custom
context
dir
# perl
ruby
virtualenv
# nvm
# aws
go
# elixir
git
# hg
status
cmd_exec_time
)
We can enable segments and define their order. To avoid the need of recompiling the program all the time the user wants to make a slight change I more than likely see this ENV variable approach useful.
Let's elaborate on how we could solve this problem! :)
Title pretty much says it. When you are in your home directory you should see ~ not /home/user/ as your path.
Add Go Documentation.
In both ZSH and BASH sometimes when I'm typing long instructions, the line of text may become invisible for some reason.
For cars like python, nodejs, etc which try to execute a command line call and if the command does not exist, only the car's background is visible.
All these need to have a default text, like [_._._]
displayed, or something. When debug mode is on (BULLETTRAIN_DEBUG=true
), then kindly put the problem in the text, like command not found.
The dir
car should have a switch to show only the last bit of the path. For example if the path is /usr/share/apps
the dir
car should allow to show only apps
.
Deciding which cars can be rendered is decided sequentially. Maybe it's slow as globbing of files is involved too. Need to investigate if this process needs speeding up.
What if we have a list of cars that are used, then a user can add a car they wrote to that list. The car can be potentially any language really but we would, of course, recommend go. These plugins are just binaries of some sort, that print something to stdout.
So this is how it would work. User exports BULLETTRAIN_CARS="time date context my_car"
at runtime, we see my_car we look for it internally if it doesn't exist we run bullettrain_my_car binary (they would have to name their plugin a certain way for it to get executed). This then appends info to the prompt? Is this doable?
Add unit and benchmark tests as a minimum, per car.
When setting BULLETTRAIN_CAR_TIME_SYMBOL_PAINT it also changes the color for BULLETTRAIN_CAR_OS_SYMBOL_PAINT
Implement a calendar date car. Use optional env var to override date format.
Find out how to show the segment until their built in triggering effect kicks in.
If the design offers multiple trigger options, implement it that way to be able to choose from triggering effects (only one trigger can be active).
Hi,
Trying to get version of this built for my freebsd box, using zsh again so want to get back to using this great prompt.
I cloned the repo into my go path and ran dep ensure --update and I get the following error.
Solving failure: No versions of github.com/bullettrain-sh/bullettrain-go-git met constraints:
v0.7: Could not introduce github.com/bullettrain-sh/[email protected], as it requires package github.com/bullettrain-sh/bullettrain-go-core/pkg/ansi from github.com/bullettrain-sh/bullettrain-go-core, but in version that package is missing.
v0.6: Could not introduce github.com/bullettrain-sh/[email protected], as it is not allowed by constraint ^0.7.0 from project github.com/bullettrain-sh/bullettrain-go-core.
v0.5: Could not introduce github.com/bullettrain-sh/[email protected], as it is not allowed by constraint ^0.7.0 from project github.com/bullettrain-sh/bullettrain-go-core.
master: Could not introduce github.com/bullettrain-sh/bullettrain-go-git@master, as it is not allowed by constraint ^0.7.0 from project github.com/bullettrain-sh/bullettrain-go-core.
As long as you are in a directory under $HOME always print ~ instead of the full path.
I switch between bash and mksh on my bsd boxes. It would be nice to have this work in korn shell.
The string produced by each car should be defined by some kind of template which would be possible to override via env variable. For example I would like to have each car in the following format:
{space}{icon}{space}{text}{space}
With the current setup, I have to override the icon and the separator env vars to include the spaces.
Using Linux, ZSH, two line setup.
On command completion the prompt gets temporarily indented.
Almost every car needs to know about the pwd
value. Can it be moved into core
and passed onto the cars so they won't need to run it themselves? Some cars may need it multiple times.
Try to figure out how this can be implemented.
If there are any number of background jobs, display the count number.
The hardest part is, that the current jobs are only visible to the current terminal session, that is the parent process of the new background ones.
The status
car should have a switch to show only the status icon but no return code.
Right now, my biggest design problem is: how to automate the separator colours at the end of the segments so they are properly coloured. Also how to be able to configure them through env variables, plain strings, whereas they are now types in Go. We'd need a system there that is not complicated. We can change 3rd party colour library or even write our own colouring system.
Any ideas and PRs are welcome.
Implement logic to build right prompt section for ZSH.
I have merely copied a Code of Conduct documentation which is widely popular in the open source space. Please feel free to have a look at it and suggest modifications, additions, fixes!
I think it would be nice to offer support for some default color themes. Where a user can specify a theme and have some good-looking colors. Maybe support for solarized and nord out of the box along with any other popular themes out there.
I would expect that this configuration:
export BULLETTRAIN_CAR_DIRECTORY_MAX_LENGHT='1'
export BULLETTRAIN_CAR_DIRECTORY_DEPTH_INDICATOR=''
export BULLETTRAIN_CAR_DIRECTORY_PATH_SEPARATOR='/'
export BULLETTRAIN_CAR_DIRECTORY_FIRST_DIR_SHOW='false'
when in /usr/share/man/man3
will show only man3
.
Allow the user to customize the separator for the directory car, so each directory can appear as a segment. Possibly enable this by default, I personally think it looks good from a ux stand point.
Simple question to discuss: under what licence do we create our code?
Would be nice if Kubernetes Context car plugin is implemented like it is for the bullet-train.zsh version caiogondim/bullet-train.zsh#257
How about we create an IRC channel on Freenode so we can talk in real time and work on this? I created #bullettrain if you want to meet me there or just /query gregf and we'll talk.
outpout: user@hostname
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.