Skip to content

Conversation

@AdityaShome
Copy link

Changes

This PR implements dedicated terminals for each tab in the Pippy activity, improving the user experience when working with multiple Python scripts.

Problem

Previously, Pippy used a single terminal shared across all tabs. This meant that:

  • Running code in one tab would affect the terminal state for all tabs
  • Output from different scripts would be mixed in the same terminal
  • Stopping a running process in one tab would affect all tabs

Implementation

This PR introduces:

  • A dedicated terminal for each editor tab using a Gtk.Stack container
  • Automatic terminal creation when switching to or creating a new tab
  • Tab-specific process management (each tab maintains its own Python process)
  • Terminal context switching when the user changes tabs
multi-terminal-support.mp4

Benefits

This enhancement creates a more consistent and isolated coding environment where:

  • Users can run and stop scripts independently in different tabs
  • Terminal output is preserved per tab when switching between tabs
  • The execution state of one tab doesn't affect others

The implementation maintains backward compatibility while providing this improved multi-tab terminal experience.

@quozl
Copy link
Contributor

quozl commented Apr 29, 2025

But now I can't work on another source file in the same program, because every time I switch to the other tab the terminal disappears!

@AdityaShome
Copy link
Author

Exactly that's the issue and this PR resolves that by providing separate terminals for each tab, also maintaining the running execution state. It also stores the running terminal output independently, so switching between tabs will neither interrupt the processes or nor erase it until user decides to do it by clear button. It is also very helpful in case user wants to check previous outputs in any tabs.

@quozl
Copy link
Contributor

quozl commented Apr 30, 2025

No, you misunderstand, if I'm in the middle of debugging a two file program, and have an error message in one terminal, then as soon as I switch to the other tab the message is no longer visible.

@AdityaShome
Copy link
Author

AdityaShome commented Apr 30, 2025

Thanks for the clarification, I understand now while working with 2 source files of a same program, errors from different files should be visible while switching tabs. To support the use case, I can create any of the following :

  • a split view support enabling to open multiple tabs and terminals at same time.
  • global terminal like previous case displaying all outputs in a single view.
  • option to pin terminal that keeps it visible while switching tabs.

Let me know which approach aligns the best or any other suggestions.

@quozl
Copy link
Contributor

quozl commented May 2, 2025

Thanks.

It is starting to sound way too complicated for an elementary school child learner, who in general have trouble understanding the most basic user interface elements. The features you describe are available in VS Code and other environments, so if a teacher needs to support more complex workflows like this they can upgrade their lesson plan to a different tool.

By the way, Pippy's documentation for teachers is hosted at
https://help.sugarlabs.org/en/pippy.html

and comes from the source file https://github.com/godiard/help-activity/blob/master/source/pippy.rst

So a more complete understanding of this problem may be had by planning the changes you would make to the documentation, always considering the elementary school teacher as the audience. Always in a rush, worried about classroom management, and just wants software to support learning in class or at home.

@AdityaShome
Copy link
Author

Thanks for the feedback, that makes sense. I agree that we should keep Pippy simple for young learners. I’ll did check out the documentation and will make sure any proposed changes stay aligned with what teachers need that is easy to use, quick to understand, and focused on learning.

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

Successfully merging this pull request may close these issues.

2 participants