Skip to content

Output Upstream Activity #531

Description

@adkins17

Potato-Output-Follow-Upstream.patch

Output following and scrollback

Incoming text previously followed only when the text widget's current yview
fraction ended at exactly 1.0. Deferred layout, resizing and wrapping could move
that fraction away from the bottom and leave subsequent output offscreen. Sending
a command also left the view in scrollback, hiding the response.

This change records follow intent separately for each output widget. Explicit
scrolling or selecting text pauses following; output insertion and layout changes
do not. A coalesced idle callback returns live widgets to the bottom after layout.
Sending a command resumes the active output without changing keyboard focus.
Typing or saving input history without sending preserves the reading position.

The stock skin adds a Live output / Scrollback: Latest button beneath the
existing status fields. Clicking it clears the current selection and resumes
following. Existing End and mouse-wheel navigation also update follow intent.
Hidden tabs retain their intent and follow on remapping. Destroyed widgets cancel
pending callbacks; repeated hook installation does not duplicate traces/bindings.

Independent upstream patch

Repository: https://github.com/potatomushclient/potato

Base: 46d18387bd6b156b85176fa588a60991cbba6235 (upstream master when prepared).

This patch includes its own potato-output-follow.tcl helper and loads it from
the core. It requires none of the Workspace UI, reload, diagnostics, save-world,
or custom-selection patches. It does not change world persistence, native
libraries, or the existing /reload implementation.

Apply from a clean checkout at the stated base:

git apply --check /path/to/Potato-Output-Follow-Upstream.patch
git apply /path/to/Potato-Output-Follow-Upstream.patch

Launch Potato normally after applying. This is a source patch; it does not update
an already packaged executable. The running Workspace client already has an
equivalent local fix; do not apply this upstream patch on top of its modified
checkout.

Testing

The included Windows runner requires a standalone Tclkit executable that includes
Tk. It copies only source, the test, and that runtime into a disposable directory,
creates a minimal profile, disables autoconnect/update checks, and stubs network
connection/sending. It does not load the user's potato.custom or saved worlds.

./tests/Test-OutputFollowing.ps1 -Runtime C:/path/to/tclkit-with-tk.exe

The test also runs directly with a Tcl/Tk interpreter from a disposable copy whose
root has the same minimal profile; do not run it against a live user profile.

Twenty-one assertions passed with Tcl/Tk 8.6.18 on Windows. Coverage includes
actual receive/system/prompt and Return handlers, geometry changes, wrapped
bursts, font changes, deliberate scrollback, disjoint selections, wheel/End
navigation, button invocation, hidden tabs, and callback cleanup. The
inactive-application rendering branch is tested with a deterministic focus-query
stub and a check that rendering makes no focus requests. This does not claim
OS-level focus switching was automated.

The helper uses Tcl/Tk 8.5-compatible constructs to match upstream's minimum;
the test run verified 8.6.18, not a separate 8.5 runtime. Re-sourcing the helper
is tested; the upstream /reload implementation itself is outside this patch.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    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