Open ReneFroger opened 2 years ago
That's a cool use, and definitely looks like a bug reading the input. Thanks for reporting it!
I think this is to be expected. What is happening here is that you are starting up an interactive app, and WTFUtil is probably not getting any output to render. CmdRunner is really running a script every interval and is not an embedded terminal. If the command does not exist and/or the output can not be piped to another command, then I would not expect CmdRunner to work.
If you could somehow send the SIGINT as part of the SSH command to connect and disconnect, it MIGHT work as expected.
But if you want interactivity, you probably want to make this a window using an actual terminal window manager like tmux, screen or the various alternatives.
I am minimally going to replicate this behavior with a few other things and try to catch and display a more relevant description
I appreciate that you're trying to replicate this behavior.
I have looked around how to send a SIGINT as part of SSH command. Based on this answer], I tried to replicate with:
cmd: "ssh"
args: ["devzat.hackclub", "\"sleep 99 < <(cat; kill -INT 0)\" <&1"]
But I got only error code 255 with it. I don't need interactivity, but only watching if some messages appear in the chat of WTFutil dashboard.
Yeah, partly likely due to the fact that you are connecting to the chat and not an expected ssh terminal.
I will call out that if this worked, what other people would see is that you've connected to the chat for a bit, then disconnected and reconnected.
@Seanstoppable's comment has reminded me that this has come up before, in other use-cases, for the very same reasons. CmdRunner
is unlikely to solve the problem for you.
IMO WTF needs two new modules:
I believe we actually have a 'tail mode', which might be 2?
But yeah, an actual terminal would be interesting.
I actually can't seem to replicate the crash mentioned in your original post @ReneFroger . I just realized I think part of the problem is a bad config. Should look more like:
wtf:
mods:
task:
#term: "xterm-256color"
#term: "aterm"
type: cmdrunner
cmd: "ssh"
args: ["devzat.hackclub.com"]
enabled: true
refreshInterval: 25
If you add pty: true, you get some sort of output, which means that doing this might actually be possible.
I am going to have a fix for the bug you actually uncovered (we blow up if no modules defined).
With the following setup:
test:
#term: "xterm-256color"
#term: "aterm"
type: cmdrunner
cmd: "ssh"
args: ["devzat.hackclub.com"]
enabled: true
pty: true
position:
top: 2
left: 2
height: 4
width: 2
refreshInterval: 25
I see this:
But when I do ssh devzat.hackclub.com in same terminal, I actually see the output:
Any suggestion where I might went wrong?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
First, I would like to say how I appreciate your tool, it's awesome! However, I ran into a problem.
What's broken?
In any terminal, when you try
ssh devzat.hackclub.com
(from this nice package), it works fine.But when you try to wrap that command into WTF task, you get a strange error:
Sample of configuration where you can replicate this error:
The author of devzat thinks I should report it here, which I'm doing now. And frankly, I think it's related with wtfutil, because in all other terminals you will not see this kind of error. What could be causing this error, and how could we display such tools via SSH via wtfutil?