Comments (8)
Seems like trying to be POSIX is not always the solution (well fish itself is not POSIX so hey, so I wont complain here).
Will try to see how to fix that before releasing fishline v3. In the same time you may want to fall back to the simple status
segment then)
For your link I am not sure this solution would be also compatible with OSX / BSD derivative, I will pop up a Ubuntu 16.04 VM in order to check this out.
Thanks for your report !
from fishline.
Awesome. Just a note-- it also happens in bash/dash with the procps-ng `kill' at least on Ubuntu 16.04 when using the non-builtin, as the issue is with the actual implementation of the list function. I'll try to raise it with the procps-ng maintainers too, just to see if they have a good reason for not identifying the signals or using shorthand (e.g. --list= works but not -l )
from fishline.
Just tested some stuff, all kill implementation that I was able to test (latest Ubuntu [procps-ng], latest Debian [procps-ng], latest alpine [busybox kill] and OSX [BSD kill & GNU gkill]).
It seems like using a simple math $status - 128
to retrieve original signal code works perfectly as an argument to all of those operation (kill -l kill --list=(math $status - 128)
). So we have a solution for that.
The blocking factor is that kill -l $sigcode
does not work on procps-ng
while kill -l$sigcode
or kill --list=$sigcode
works only on procps-ng. I may be able to add a fix in the init.fish script in order to check what kill
version is availlable in order to choose the right on in the sigstatus
segment as only the procps-ng
version expose a -V
option to check its version.
Something like
kill -V ^/dev/null | grep "procps-ng"; and set FLINT_NGKILL true
Another solution, that might be cleaner is to generate the list of signal code just based on kill -l
as querry them via their index. The thing is I dont know how multi platform this solution would be, but from what I have tested /bin/kill -l| tr ' [a-z]' '\n[A-Z]'
will always generate an ordered list os signal from 1 to 31.
Will try to take a closer look at it but yeah, the fact that kill -l $sigcode
with a space does not work is a bummer.
from fishline.
Just pushed a fix to branch bugfix/sigstatus (dev...bugfix/sigstatus). If you wish to test this, I will do my best to test that with other kill
implementation in the same time.
Just be aware that this is based on fishline v3 dev branch so if you are currently running fishline v2 just be aware that you will need to update the way you initiliaze it (see release v3.0.0-beta.1).
Edit: miss clicked the close issue ...
from fishline.
I'll certainly take a look at the fix tomorrow when I'm at my work machine.
I'm gonna open an issue with procps-ng kill to see if they can do a shorthand argument form for kill -l $sigcode
. Won't matter too much to solve the issue now, but would allow to make it simpler in the future. I bet they have some reason for not emulating kill, but who knows.
from fishline.
Yes, I dont really know why that wouldn't be compatible with pretty much all other implementations on this specific issue.
In a way this fix should perform better than the old implementation (as it does only call kill
once for the whole session) but we never know. Keep me informed when you had time to test this !
from fishline.
I just tested with procps-ng kill
and it appears to work well. Sent some signals to a process and also did things with process num > 128 (e.g. -C) and it all looks good to me.
from fishline.
Thank you very much for this, I just updated the segment to use $status - 128
to querry the signal instead of just $status
so yeah, glad it works now !
FYI, the fix will be merged soon and availlable in the next beta release (fishline v3.0.0-beta.2
) which is scheduled for this week.
from fishline.
Related Issues (20)
- Join Wahoo? HOT 4
- Cygwin compatibility HOT 2
- Update documentation to match `fishline v2.0.0`
- Update Development section of the Wiki
- Update Segments section of the Wiki to add customizable symbols
- Fonts HOT 2
- How to have just a single line? HOT 3
- Can't get it to work HOT 5
- Terminal Crash on Resize (urxvt) HOT 6
- duplicate entries added to $fish_function_path, resulting in no function loading HOT 2
- Support Fisher 4.1.0 HOT 2
- ^^ /dev/null HOT 1
- Unable to install the plugin using fisher v4.3.1 HOT 2
- TTY theme is used in flatpak terminals HOT 2
- Awesome project
- Use '-s' Flag For USERHOST Segment
- Same line w/ right prompt?
- Make fishline compatible for fish_right_prompt HOT 6
- What about a port to Oh-My-Fish? HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fishline.