waveterm icon indicating copy to clipboard operation
waveterm copied to clipboard

[Feature]: Custom widget commands should read RC files

Open JameInw opened this issue 11 months ago • 7 comments

Current Behavior

I tried writing Custom Widgets that are CLI Widgets

"WakeOnLan-XXXXX": {
    "icon": "power-off",
    "label": "WoL-HA",
    "color": "#F72C5B",
    "blockdef": {
      "meta": {
        "view": "term",
        "controller": "cmd",
        "cmd": "wakeonlan FF:FF:FF:FF:FF:FF",
        "cmd:closeonexit" : 0
      }
    }
  }

But when I tried it, the result was

zsh:1: command not found: wakeonlan process finished with exit code = 127

Even though I tried the command myself, it worked. Note: I tested it on Macbook Air M2

Expected Behavior

I hope it will work in the future.

Steps To Reproduce

  1. Macbook Air M2
  2. Use ZSH
  3. Use Script
"WakeOnLan-XXXX": {
    "icon": "power-off",
    "label": "WoL",
    "color": "#F72C5B",
    "blockdef": {
      "meta": {
        "view": "term",
        "controller": "cmd",
        "cmd": "wakeonlan",
        "cmd:closeonexit" : 0
      }
    }
  }

Wave Version

Client Version 0.10.1 (202412130327)

Platform

macOS

OS Version/Distribution

MacOS 15.1.1

Architecture

arm64

Anything else?

No response

Questionnaire

  • [ ] I'm interested in fixing this myself but don't know where to start
  • [ ] I would like to fix and I have a solution
  • [X] I don't have time to fix this right now, but maybe later

JameInw avatar Dec 13 '24 13:12 JameInw

To confirm, is ZSH your primary shell? Is this a custom script you've written or something you've installed?

esimkowitz avatar Dec 13 '24 18:12 esimkowitz

Ah ok we run custom widgets in the login shell to reduce overhead. This likely doesn't have your RC files loaded. As a workaround can you try the following:

source ~/.zshrc && wakeonlan

esimkowitz avatar Dec 13 '24 18:12 esimkowitz

To confirm, is ZSH your primary shell? Is this a custom script you've written or something you've installed?

Yes, I mainly use ZSH shell, and yes, this is a script I wrote myself.

JameInw avatar Dec 14 '24 06:12 JameInw

Ah ok we run custom widgets in the login shell to reduce overhead. This likely doesn't have your RC files loaded. As a workaround can you try the following:

source ~/.zshrc && wakeonlan

I was using the source ~/.zshrc command before using wavetrem.

JameInw avatar Dec 14 '24 06:12 JameInw

You shouldn't need to do that, we source it for the terminal blocks, we don't for the command widget config though

esimkowitz avatar Dec 14 '24 09:12 esimkowitz

Hi everyone, I have the same behavior. I already tried to run "source ~/.zshrc && custom command" but it doesn't work. (command not found) At this point I paste the full path of the binary I want to start, but the binary runs another one and waveterm says not found.

I'm on macOS with zsh.

KoalaWSMTW avatar Feb 23 '25 19:02 KoalaWSMTW

Hi ! Same here in Ubuntu 24.04 snap version

rjousse18 avatar Feb 28 '25 13:02 rjousse18