Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When multiple terminals are present in the same page only the last one is used as an output #27

Open
perellonieto opened this issue Oct 12, 2023 · 1 comment

Comments

@perellonieto
Copy link

perellonieto commented Oct 12, 2023

I want to create a step by step guide on how to use Python and I have tried to create multiple block codes with an editor and a terminal. It seems that when there are multiple terminals in the same page only the last terminal is used as the output of all of them. However, the input (when clicking on run) seems to be associated with their respective code block.

The following is an example of the problem (with quarto version 1.3.450)

```{shinylive-python}
#| components: [editor, terminal]

print('This is the first code.')
```

```{shinylive-python}
#| components: [editor, terminal]

print('This is the second code.')
```

```{shinylive-python}
#| components: [editor, terminal]

print('This is the last code.')
```

An online example can be found at https://tailor-uob.github.io/mooc_trustworthy_ai/cha_sl/shinylive-not-working-terminals.html
and its source code at https://github.com/TAILOR-UoB/mooc_trustworthy_ai/blob/main/cha_sl/shinylive-not-working-terminals.qmd

Is there a way to fix this?

@perellonieto
Copy link
Author

The issue #28 may be related to this one as I realized that the editor-terminal mode does not support the #| standalone: true argument.

```{shinylive-python}
#| standalone: true
#| components: [editor, terminal]

print('This is the first code.')
```

which fails with the following error '#| standalone: true' is not valid for editor-terminal and editor-cell code blocks..

However, adding a viewer and the #| standalone: true argument is able to generate the html page, but the problem of only the last terminal being used as an output persists.

```{shinylive-python}
#| standalone: true
#| components: [editor, viewer, terminal]

print('This is the first code.')
```

```{shinylive-python}
#| standalone: true
#| components: [editor, viewer, terminal]

print('This is the second code.')
```

```{shinylive-python}
#| standalone: true
#| components: [editor, viewer, terminal]

print('This is the last code.')
```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant