Skip to content

Running 'Jaguar: Flash' action while having an open 'Jaguar: Monitor' terminal misbehaves #187

Open

Description

@kasperl

Looks like we just try to issue the command 'jag flash ...' in the same terminal without stopping the running program. I would expect this to run in another terminal and fail instead.

Activity

  1. lask commented on Jan 6, 2022

    @lask
    Contributor

    It is exactly what we do. You can only have one thing running on each port at a time which is why we reuse the terminal. If we run it in a new terminal, then you can end up with many terminals and will have to manually close all the terminals. I am not convinced that is better.

  2. lask commented on Jan 6, 2022

    @lask
    Contributor

    We can send a Ctrl-C to make sure that everything is actually sent. Would that be better?

  3. kasperl commented on Jan 6, 2022

    @kasperl
    ContributorAuthor

    Do we know that we're reusing the terminal (if it is already running)? If so, we could also just abandon the operation because it is not going to work and tell the user.

  4. lask commented on Jan 6, 2022

    @lask
    Contributor

    We could know whether the terminal is already running (right now we don't), but we do not know whether the previous command has exited. I think there are two way to do this but neither is optimal.

    Using VS Code output
    We could use an output instead of a terminal. In this case, we would use the node child_process lib to execute the commands and just forward the output to the appropriate output window.

    The advantage would be that we can use the child process to keep track of the state of the command. In other words, we could know whether the previous command is still running.

    The disadvantage here is that there is no good way to cancel a running command. We cannot extend the output view with buttons for interrupting the child process which I assume is to prevent extension developers to use outputs for other things than output. This issue extends to commands that require user interaction where we have no way of doing the interaction (we try to not use commands that require user interaction, but we have had changes to the CTL that would have been breaking for the VS Code extension if we were using output). If a command that uses a port doesn't terminate, then we have blocked that port (until it is reconnected) which is not great.

    Using VS Code terminal
    This is what we use. We open a terminal and send commands to it.

    The advantage is that it is simple and a user can always interact with the terminal. The disadvantage is that it is simple, so we cannot know whether commands are running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions