theia: Output of short-lived tasks is not shown

When executing a task that ends quickly, like:

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "A task",
            "type": "shell",
            "command": "echo",
            "args": ["foo"]
        }
    ]
}

The task ends quickly, before the terminal widget has time to initialize in the front-end. The results is that the terminal widget fall back on starting the default shell. This appears in the error console:

ERROR Error attaching to terminal id 11, the terminal is most likely gone. Starting up a new terminal instead.

cc @marechal-p who reported this to me

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 22 (21 by maintainers)

Commits related to this issue

Most upvoted comments

@simark Can I remove this line ? I’m trying resolve this issue, And by removing that line (with one more little change) I succeeded to see output of short-lived task. I want to ensure that it doesn’t harm anything else…

The user will be responsible to unregister the process as suggested here cc @marechal-p

I haven’t worked on Theia for a while, but from a quick glance I don’t thing that would be the right fix. Perhaps it happens to work by chance, because it makes it that some listener for this event is not called. Or, because this._killed is not set (in handleOnExit). I don’t really know.

But just removing this one call, and leaving the other one (where signal is set) seems strange.

If this is a timing issue (which it likely is), you should be able to artificially add some delay somewhere to make it reproduce reliably.

Do you have any updates on this? I just encountered the same issue, which looks critical to me. I wonder if I could help 🤔…

@a1994846931931 there was some prerequisite work done to improve processes before the issue could be tackled, but it should be possible now. @marechal-p was the original author of the processes improvements, and has also shared his design idea for the issue https://github.com/eclipse-theia/theia/issues/2961#issuecomment-566217381 if you’d like to take a look. I don’t believe he has the bandwidth at the moment to take a look into the problem.

Do you have any updates on this? I just encountered the same issue, which looks critical to me. I wonder if I could help 🤔…

@vince-fugnitto I don’t have a clear picture of what could be done to fix this. Let’s talk about it in detail next Monday (Aug 5) in office. would it work for you ?