Skip to content

TeraTerm Bug, scroll buffer cannot be cleared #1007

@ghost

Description

TERATERM BUG REPORT

Submit at: https://github.com/TeraTermProject/teraterm/issues/new


Title: Alternate screen buffer (DECSET 1049) and CSI 3 J not working over serial connection


Environment

  • Tera Term version: 5.5.1
  • Windows version: [your Windows version]
  • Connection type: Serial port (USB CDC, 115200 baud)

Problem Description

The alternate screen buffer escape sequences (ESC[?1049h / ESC[?1049l) do not work when connected via serial port. Content written while in "alternate screen" mode appears in the main scroll buffer instead of a separate buffer, and exiting alternate screen mode does not restore the previous screen contents.

Additionally, the CSI 3 J (Erase Saved Lines / clear scroll buffer) sequence has no effect, even with ClearScrollBufferFromRemote=on set in TERATERM.INI.

TERATERM.INI Settings

AlternateScreenBuffer=on
ClearScrollBufferFromRemote=on

Steps to Reproduce

  1. Connect to a device via serial port (e.g., COM3 at 115200 baud)
  2. Device sends: ESC[?1049h (enter alternate screen buffer)
  3. Device sends: ESC[2J ESC[H (clear screen, home cursor)
  4. Device displays a full-screen application (e.g., text editor)
  5. User exits application
  6. Device sends: ESC[?1049l (exit alternate screen buffer)

Expected Behavior

  • Step 2-4: Application displays on alternate screen
  • Step 6: Previous screen content (before step 2) is restored, application content disappears

Actual Behavior

  • All content appears in the main scroll buffer
  • Exiting alternate screen mode does not restore previous content
  • Scrolling up shows remnants of the full-screen application mixed with previous output
  • ESC[3J does not clear the scroll buffer

Additional Context

This is for an embedded Forth system (Raspberry Pi Pico) that uses VT100 escape sequences for full-screen editors. The same escape sequences work correctly in other terminal emulators (e.g., xterm, Windows Terminal).

The application sends:

  • On entry: \x1b[?1049h then \x1b[2J\x1b[H
  • On exit: \x1b[?1049l

Workaround Attempted

Tried using ESC[3J (clear scroll buffer) before and after the application, with ClearScrollBufferFromRemote=on - no effect.

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