Skip to content

Terminal overwrite text on overflow #5092

Closed

Description

@Vrajs16

To Reproduce

Create a postgres db and connect and start typing and you will see if overwrite

Current vs. Expected behavior

It should continue or atleast go on the next line and not overwrite the text as I right.

Screen.Recording.2026-08-15.at.6.14.00.PM.mov

Provide environment information

Dokploy version 30.0

Which area(s) are affected? (Select all that apply)

Databases

Are you deploying the applications where Dokploy is installed or on a remote server?

Same server where Dokploy is installed

Additional context

No response

Will you send a PR to fix it?

Maybe, need help

Activity

  1. linear-code commented on Aug 15, 2026

    @linear-code
  2. dosubot commented on Aug 15, 2026

    @dosubot

    Hi @Vrajs16! This is a terminal sizing issue with xterm.js — the FitAddon calculates the terminal's column count once at mount time via addonFit.fit() [1], but there's no ResizeObserver or window resize handler to recalculate when the container dimensions change. This means the cols value goes stale, so the cursor position wraps incorrectly and new characters overwrite existing text instead of advancing.

    A closed PR (#1135) addressed exactly this — it added a ResizeObserver to re-call addonFit.fit() on container resize and synchronized the updated cols/rows to the backend PTY via WebSocket [2]. It was never merged, but it serves as a good reference.

    To fix this in docker-terminal.tsx, you'd need to:

    1. Add a ResizeObserver that calls addonFit.fit() when the container size changes.
    2. Send the new dimensions to the server via the WebSocket so the backend PTY resizes to match.

    A minimal client-side addition would look like:

    const resizeObserver = new ResizeObserver(() => {
      addonFit.fit();
    });
    resizeObserver.observe(termRef.current!);
    
    return () => {
      resizeObserver.disconnect();
      ws.readyState === WebSocket.OPEN && ws.close();
      term.dispose();
    };

    The server-side (docker-container-terminal.ts) would also need to handle a resize message to call pty.resize(cols, rows). PR #1135's diff has the full implementation you can use as a starting point [2].

    To reply, just mention @dosu.


    Share context across your team and agents. Try Dosu.

    Leave Feedback Learn about dokploy with Dosu Add Dosu to your team

  3. added a commit that references this issue on Aug 17, 2026
    b53ffac
  4. added 2 commits that reference this issue on Aug 17, 2026
    ff275fe
    c0265b4
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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions