-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fishline v3.0.0 #20
Merged
Fishline v3.0.0 #20
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Segment, Tests, Glyphs & Colors are now all separated - Provide sensible default_colors.fish & default_glyphs.fish - Fishline now uses fish_functions_path to autoload its internal functions and segments - Use an init.sh script to load default config & update fish_functions_path - Glyphs are now provided in the themes/default_glyphs.fish file instead of in each segment file (easier for theming) - Tests are now separated and loaded only when needed - Provide a FLINT_VERSION fuction (associated with the fishline -v flag) to make debuging easier
- init.fish is now in the root of the repository (as it is not really a config file) - internal functions are moved to an internals folder as only the fishline function should be 'public' - internals/ now refers to internal functions - functions/ now refers to exposed functions to the user - segments/ still refers to segment dirs - tests/ now refers to test files - themes/ still refers to different availlable theme
- Add -x option to list all availlable segment - Add -v option to show fishline version - Add -h option to show a small usage for fishline - Update test/run.sh to use `fishline -x` to list availlable segment
- Default colors: - Now provide a default_ansi_colors theme & deafult_256_colors - It is loaded by default via init.sh based on `tput colors` output - Default symbols: - default_glyphs.fish has been rename to default_symbols for clarity - Now load default_glyph by default when terminal is not perceived as a TTY & tty_compatible instead when perceived as one
- VIMODE: remove force delete of fish_mode_prompt as it was shown the first time nonetheless. Will require the user to deactivate the default fish_mode_promopt by creating an empty function - PWD: now uses prompt_pwd instead of the path directly as some modification will be added to this function alowing the user to set the abbreviation length (fish-shell/fish-shell#2473)
- fishline internal commands are now registered as private function using the `__` prefix notation - This way when listing all availlable function using `functions` you will not have all the fishline internal command shown - Some discussion need to be made for segments (does we need to register them as private or not)
- `__FLINT_SEGMENT` & `__FLINT_SEGMENT_CLOSE` now replace old `FLINT_CLOSE` for better clarity - Added small README.md in internals about what are the internal variable and function used, by what function and what they are used for
- Internal command are now prefixed with __fishline_ instand of __FLINT_ - FLINT_ prefix is now reserved for internal variables and cleanup after execution - New namiong convenvtion for internal command will require this prefix & the use of snake_case instead of full UPPER_CASE
- segment are now prefixed by `__flseg_` instead of `FLSEG_` making them show as private function in fish's `functions` listing. All name are now in lowercase to match an standard idomatic shell naming covention - tests prefix have also changed from `FLTEST_` to `fltest_` with the same change for the naming convention. - tests/run.sh has been modified with a quick usage & the possibility to load themes before testing any segment
- init.fish will now elevate realpath on system where it exists or when running fish 2.3 - this will help 3rd party installation such as the one using fisherman
- Add a new 256 colors default theme - Add separator color to default themes - Keep old default theme as `themes/legacy_256_colors.fish`
Bugfixe required before merging
|
- Sigstatus now use a initiliazed list of status name generated from `kill -l` - Should work on all kill implementation that list status from 1 to 31 in order when doing a `kill -l` - Should be a little bit more efficient as we are now just querrying a variable instead of calling kill everytime
- rename signal code variable to FLSEG_STATUS_NAME - add information about this var in internals/README.md
- Add `FLINT_INVERT` global variable & logic to create an inverted open to a segment (making diamond shape segment possible with powerline glyphs) - Segment logic has been updated to control a whole segment and not just the creation the opening of one via the use of global var (next point uses this to provide better customization to your segment) - Add `pre` and `post` optional argument to `__fishline_segment` which allows you to ignore `FLSYM_{LEFT|RIGHT}_PRE` and `FLSYM_{LEFT|RIGHT}_POST` in the segment creation. - Add `FLINT_PRINT_POST` global variable which is used by the new arguments of `__fishline_segment` to control printing of `FLSYM_{LEFT|RIGHT}_POST` when closing the segment - Breaking change in themes is introduced as post & pre have been inverted as we now want to consider them inside a segment instead of as post & pre of a segment separator
- With the updated logic of `fishline`, FLINT_BCOLOR is now a global variable present for the whole execution of the the main function and does not need to be removed by the segment. The logic that needed this is also now externatlized to `__fishline_segment_close`.
- separator segment now uses the new `__fishline_segment` logic instead of a dirty hack
- Simple empty segment that just control the invert factor of the next segment.
- Add colors & symbols for `separator` segment - Invert `FLSYM_{LEFT|RIGHT}_POST` and `FLSYM_{LEFT|RIGHT}_PRE` to matche `__fishline_segment` breaking changes.
- Print a fish using powerline segment if used in your theme - Else will print an ascii art of a fish `>((*>`
- Fixes #21 on system using procps-ng - Change the logic of sigstatus segment to use a static list of signame instead of calling kill everytime
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This new version of
fishline
consist of a complete refactoring of the code base to elevate a lot of internal feature offish
that were left aside originally. Its also contains some small changes to be compatible with the new2.3.0
version offish
.Changelog
Breaking changes
init.fish
instead offishline.fish
in order to be compatible with plugin managers such asfisherman
. When upgrading fromfishline v2
you will need to update your loading script for fishline (see the Installation section of this comment).FLSYM_{LEFT,RIGHT}_PRE
andFLSYM_{LEFT,RIGHT}_POST
have been moved around to make way more sense.PRE
is now used when a segment opens andPOST
when it closes.PRE
andPOST
are now named around the segment it belongs to and not the separator as previously. This can break themes that were using those symbols and values for those variables should be swapped around.Major changes
fish
function autoloading instead of loading everything itself. This makes the initialization script faster. It also makes segment modifications and new segment load automatically.fishline
__
making them show asprivate
function (i.e not shown when listing functions usingfunctions
)segments/__flseg_segment
&tests/fltest_segment
)snake_case
and expose a function named__flseg_segment_name
in a file with the same name (necessary for fish autoloading).snake_case
with the private__fishline_
prefix instead of publicly exportedFLINT_
tests/run.fish
fishline
are now case insensitive (for backward compatibility)themes/tty_compatible.fish
will be loaded by default when fishline init's detect its running in a ttythemes/default_ansi_colors.fish
orthemes/default_256_colors.fish
will be loaded depending ontput colors
outputthemes/legacy_256_colors.fish
)__fishline_segment_close
(cleaner that using an optional argument to__fishline_segment
)separator
that just creates an empty segmentfish
that prints a goldfish in your promptinvert
that will invert the next segments opening (allowing to create diamond shaped instead of arrow shaped segment)Minor changes
vimode
segment to be compatible withfish v2.3.0
pwd
segment to useprompt_pwd
function instead ofpwd
directly asfish v2.3.0
now permit customization of abbrev lengthfish_prompt_pwd_dir_length
you can now specify directory abbreviation length for this segment andprompt_pwd
in generalfishline
functionfishline -h
shows a small usage for fishlinefishline -x
lists all available segmentfishline -v
show fishline versiontests/run.fish
now have a small help, does not run all tests by default & can load themes for youtests/run.fish -h
show a small usage for the test frameworktests/run.fish -t theme.fish
asks the test framework to load a theme before runing teststests/run.fish -a
runs all tests for all segmentstests/run.fish segment_name
run tests for segment_name segmentDocumentation
The whole documentation requires an update to reflect the changes made by the big refactoring that this version consist. The wiki will see some drastic change in the near future in order to reflect all of it, the
Development
section will also finally be updated.Installation
Upgrading
As stated before, the initialization script of
fishline
has been changed thus require you to change how you are loadingfishline
. When upgrading fromfishline v2
you will need to update the section where you loadfishline
reflect this change. You will simply need to change:You previous configuration should work exactly as it was with previous version (including
fishline v1
).New installation
For a brand new installation, the
README.md
have all the necessary information required to install and configure fishline.Using Fisherman
It is to note that this release adds the support for installing
fishline
usingfisherman
. It also add the possibility to share yourfishline
theme and configuration using this plugin manager (see0rax/sharktooth
for a simple example of how this could be done).To install
fishline
usingfisherman
you will just need to run:You will then still need to create your own
fish_prompt
to usefishline
for your prompt as we do not provide a defaultfish_prompt
orfish_right_prompt
by default. If you wish to install a default prompt & theme along withfishline
see0rax/sharktooth
.We know that some people may not like to use of a package manager to configure its shell (me included) and we want to make clear that
fishline
is made to work as a standalone prompt framework forfish
and will never require you to use a third party software to install or manage it (except Git of course 😄).