I'm using autojump on Bash on Windows - I had an older laptop with the latest insider preview builds, ubuntu 16.04 and it worked fine. On my new laptop, it also worked fine, until I switched to insider preview (slow ring) and upgraded to Ubuntu 16.04.
Now I get the error message autojump_chpwd:4: nice(5) failed: operation not permitted
after every j
or cd
command. For instance:
````
$ cd ~
autojump_chpwd:4: nice(5) failed: operation not permitted
````
````
$ j sync
/mnt/c/Users/peter/Sync/
autojump_chpwd:4: nice(5) failed: operation not permitted
````
The operations complete successfully, I get to the right place and echo $?
shows 0
but the error message is very annoying. Is there anything I could do to hide it? (or even better, resolve the issue?)
Hey man,
I use rupa/z on Windows bash and I was getting a very similar error:
_z_precmd:1: nice(5) failed: operation not permitted
Check out my fork to see how I fixed it at https://github.com/Kerren/z.
Basically, you've got to redirect that standard output to null. Autojump should still work perfectly. Unfortunately, I haven't used autojump and I'm very happy with z
so I won't be able to find where this bug comes from but it's definitely able to be fixed! You just need to find the line where autojump_chpwd occurs and add >/dev/null 2>&1
to the end of it.
Good luck!
Hi. Do you also use WSL on Creators Update?
I think this is not a problem of Autojump, see the issue I just opened https://github.com/Microsoft/BashOnWindows/issues/1887.
@ruixingw I guess it's the same, yes. But I installed WSL ~a month ago and had insider slow ring. I had another laptop which was running WSL bash for ~half a year with insider fast ring, and I never experienced that issue there ... - weird
@pgrm : @daiconrad has given a good workaround: add this to your .zshrc
:
unsetopt BG_NICE
I guess you can close this issue now and let's wait for its origin: https://github.com/Microsoft/BashOnWindows/issues/1838
Most helpful comment
@pgrm : @daiconrad has given a good workaround: add this to your
.zshrc
:I guess you can close this issue now and let's wait for its origin: https://github.com/Microsoft/BashOnWindows/issues/1838