Skip to content
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 v2.0.0 #14

Merged
merged 14 commits into from Mar 2, 2016
Merged

Fishline v2.0.0 #14

merged 14 commits into from Mar 2, 2016

Conversation

0rax
Copy link
Owner

@0rax 0rax commented Aug 18, 2015

  • Major changes:
    • change in fishline usage:
      • You now pass the segments you want to print as positonnal arguments
      • You now pass the last_status to fishline using the option -s $status
      • fishline is now able to output a fish_right_prompt compatible prompt using the -r option
      • Addition of the -l option, which is on by default and will output a fish_prompt compatible prompt (just to have an opposite to the -r option)
    • fishline backward compatibility:
      • Prompt setup using the FLINE_PROMPT variable will work as expected with the previous version
      • If you don't pass your last status using the -s option, Fishline will try to get it from the first positional argument
    • Breaking changes:
      • Any theme setting one of the following var FLSYM_PRE_CLOSE, FLSYM_CLOSE, FLSYM_POST_CLOSE or FLSYM_SEPARATOR will no longer work. You will need to modify them using the replacing vars (see themes/tty-compatible.fish)
    • New segment SIGSTATUS:
      • Work as STATUS for return code < 126
      • For return code from 126 to 160 it translates return code to its meaning:
        • Translates return code 126 to 'NOEXEC'
        • Translates return code 127 to 'NFOUND'
        • Translates return code from 129 to 159 (SIGNAL return code) to their meaning
      • Examples:
        • Process exited from Ctrl+C will show SIGINT instead of 130
        • Process exited from Segmentation Fault will show SIGSEGV instead of 129
    • New internal FLINT_TEST and test script test.fish:
      • FLINT_TEST is a new internal function intended to be used to test a segment in a specific context:
        • Usage: FLINT_TEST SEGMENT1 [SEGMENT2 [SEGMENT 3]]
        • FLINT_TEST calls fishline to create a read prompt showing how the segment will be printed as a fish_prompt and fish_right_prompt
        • When FLINT_TEST_STATUS environment variable is set it will be passed to fishline before printing your segment
        • This is used to create a test function for your segment like FLTEST_SIGSTATUS
      • test.fish is the test script that will call every FLTEST_SEGNAME for the segment passed as positional argument, or all available segments
        • To create a test function for your own segment add a FLTEST_$YOURSEGMENT function in your segments/yoursegment.fish
        • This has been added to make testing of every segment easier as I am now testing fishline on Ubuntu 12.04, Debian 8 and Mac OS X Mavericks.
  • Minor changes:
    • GIT segment is now compatible with git version < 1.8.5
    • PWD segment will no longer call prompt_pwd but use its one method to transform your current path to a fish array.
    • Change in the coding style:
      • Always use [ ] instead of test for everything make a comparison between 2 argument as its clearer to read
      • We are still using test for things like test -d file or test -w folder as this is applied to a single argument and makes sense

0rax added 10 commits August 3, 2015 02:40
- No longer uses builtin function prompt_pwd to take advantages of fish-shell array variable
- Always use `[ ]` instead of `test` for everything make a comparison between 2 argument as its clearer to read
- We are still using `test` for things like `test -d file` or `test -w folder` as this is applied to a single argument
Change means to get all git information
Use git status --porcelain as it is reliable accross all git version
Use git rev-parse to check if branch is detached and the number of ahead and behind commit
It will also show you the tag when detaching to a tag
- Major changes:
  - You can now pass the SEGMENT you want to pass to Fishline as positonnal argument
  - You now pass the last_status to Fishline using the option `-s $status`
  - Fishline is now able to output a `fish_right_prompt` compatible prompt using the `-r` option
  - Addition of the `-l` option, which is the default and will output a `fish_prompt` compatible prompt
- Backward compatibility:
  - Prompt setup using the `FLINE_PROMPT` variable will work as expected with the previous version
  - If you dont pass your last status using the `-s` option, Fishline will try to get it from the first non optionnal argument (same as in v1)
- Breaking changes:
  - Any theme setting one of the following var `FLSYM_PRE_CLOSE`, `FLSYM_CLOSE`, `FLSYM_POST_CLOSE`, `FLSYM_SEPARATOR` will no longer work.
    You will need to modify them using the replacing vars (see `themes/tty-compatible.fish`)
…ll not print an error on detached commit that are not part of any tag
- Work as STATUS for return code < 126
- For return code from 126 to 160 it translate return code to its meaning
- Translate return code 126 to 'NOEXEC'
- Translate return code 127 to 'NFOUND'
- Translate return code from 129 to 159 (SIGNAL return code) to their meaning
  Exemple: - Process exited from Ctrl+C will show SIGINT instead of 130
           - Process exited from Segmentation Fault will show SIGSEGV instead pf 129
 - Change sed '-r' flag changed to '-E' as '-r' is not availlable on MacOSX
 - Change '\n' in sed expression by a call to tr (know issue with `sed -E` on MacOSX)
 - Fix test.fish sed expression as '\S' was not working as expected
 - Fix `sed` expression that added a '\n' to the PATH on MacOSX in the FULLPWD segment
@0rax 0rax added this to the v2.0.0 milestone Aug 18, 2015
@0rax 0rax self-assigned this Aug 18, 2015
@0rax
Copy link
Owner Author

0rax commented Aug 18, 2015

Bugfix required on GIT segment:

  • With git version 2.5.0: renamed / deleted files are not counted in change to commit
  • Error printed and not branch shown on a newly created git repository
  • Initializing a repository without changing directory does not trigger the GIT segment to be shown

0rax and others added 4 commits September 24, 2015 16:22
- when inside a new repository without any commit it will now show you as detached on master
- this tells you that you are in a repository that does not have a root commit
- added a trigger for the FLEVENT_GIT when the .git folder is created
@0rax 0rax closed this Mar 2, 2016
@0rax 0rax reopened this Mar 2, 2016
0rax added a commit that referenced this pull request Mar 2, 2016
@0rax 0rax merged commit 0572a8d into master Mar 2, 2016
@0rax 0rax modified the milestone: v2.0.0 May 21, 2016
@0rax 0rax removed their assignment May 21, 2016
@0rax 0rax added release and removed enhancement labels Jul 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant