Closed sommerper closed 7 months ago
I should mention that
command_pwd_command "pwd"
command_pwd_format "#[fg=blue] {exit_code} {stdout} {stderr} "
command_pwd_interval "2"
works as it writes out the complete path. Although that's not what I'm trying to achieve.
Hi,
thanks for the kind words and the bug report. Unfortunately zjstatus currently is only able to run simpler commands. The main problem is, that it needs to split the command into an array of arguments (which is currently naively implemented by splitting at the space). This will not only prevent piping (which is only possible in a shell), but also grouping of arguments by " (e.g. bash -c "pwd | base64"
won't work).
Because of this challenge I'm currently not sure how to properly fix the situation. zjstatus should recognise these kind of groups, but I'm not sure if it will suffice to just implement " and ' or if there are any other characters.
For now, the most simple solution would be to place a bash script with your command near the layout file and execute it with bash -c some.script
.
Hope this solution works until it's properly fixed in zjstatus.
With the latest release you are able to specify it with your shell. zjstatus now respects the argument grouping.
Please use a form like bash -c "pwd | base64"
for utilising pipes.
Thank you! This is so awesome!
Describe the bug I'm trying pipe commands to get the last dir name at the top.
To Reproduce Use the submitted layout / command.
Expected behavior The
{command_pwd}
command writes the last directory name.Screenshots![image](https://github.com/dj95/zjstatus/assets/1512048/4d2fdf48-e00d-48b9-a3b7-e8ea3e363249)
Desktop (please complete the following information):
Layout
How does the layout look like? Please copy it into a code block.
Additional context Thanks for such a great plugin! It's really getting better and better all the time.