franciscolourenco / done

A fish-shell package to automatically receive notifications when long processes finish.
MIT License
766 stars 70 forks source link

Error messages: "error: process ID out of range" and "basename: missing operand" #131

Closed PicoSushi closed 5 months ago

PicoSushi commented 2 years ago

Recently I'm trying done. The command sleep 6 sometimes occurs error message as below:

error: process ID out of range

Usage:
 ps [options]

 Try 'ps --help <simple|list|output|threads|misc|all>'
  or 'ps --help <s|l|o|t|m|a>'
 for additional help text.

For more details see ps(1).
basename: missing operand
Try 'basename --help' for more information.
error: process ID out of range

Usage:
 ps [options]

 Try 'ps --help <simple|list|output|threads|misc|all>'
  or 'ps --help <s|l|o|t|m|a>'
 for additional help text.

For more details see ps(1).

These messages are sometimes shown, and sometimes not. I guess that $tmux_fish_ppid is not working well.

my environment:

OS: Manjaro Linux x86_64 
Host: VirtualBox 1.2 
Kernel: 5.15.41-1-MANJARO 
Shell: fish 3.4.1 
Terminal: tmux 
franciscolourenco commented 7 months ago

@PicoSushi which command where/are you using to launch tmux? Are you using any options / parameters? Thanks!

Feko commented 7 months ago

Same thing here, seems like done comes as default in CachyOS. I'm launching tmux as:

       │ File: .config/fish/conf.d/tmux.fish
--------------------------------------------------------------
   1   │ if status is-interactive
   2   │     if not set -q TMUX
   3   │         tmux new-session -c $PWD
   4   │     end
   5   │ end

EDIT: It seems that it gets the fish pid correctly in the first attempt, but when executing ps -o command= $pid, my output doesn't include tmux* for some reason - it's just -fish. So it tries the next pid returned by ps -o ppid= - in my case it's systemd, which again doesn't have tmux*. The next ppid is 1, the next one is 0 - which errors.

Commenting the whole while block fixed it for me.

franciscolourenco commented 7 months ago

So the problem seems to be caused by the $PWD. I didn't expect this to happen since the v1.19.1.

@Feko could you check which version of done you have installed with the following command?

echo $__done_version
Feko commented 7 months ago

Hey @franciscolourenco thanks for your quick response :slightly_smiling_face: . I have:

❯ echo $__done_version
1.16.3

It seems the version that comes with CachyOS is somewhat outdated, I'll figure out how to update this. Thanks again for your prompt reply!

franciscolourenco commented 7 months ago

@Feko can you confirm if upgrading fixed the problem?

Feko commented 7 months ago

Yup, updating locally fixed it :)

On Wed, 6 Dec 2023, 08:40 Francisco Lourenço, @.***> wrote:

@Feko https://github.com/Feko can you confirm if upgrading fixed the problem?

— Reply to this email directly, view it on GitHub https://github.com/franciscolourenco/done/issues/131#issuecomment-1842432110, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPYGB6HRFA3QJZBUBSX43DYIAVORAVCNFSM52SBPCJKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBUGI2DGMRRGEYA . You are receiving this because you were mentioned.Message ID: @.***>

franciscolourenco commented 5 months ago

Fixed in v1.19.1. Please re-open if necessary.