Skip to content

Conversation

@epheien
Copy link
Contributor

@epheien epheien commented Jan 14, 2026

Summary

  • Fixed empty columns appearing on the right side of the terminal window
  • Added autocmd to trigger terminal buffer redrawing when the cursor position is valid
  • The fix listens for TermRequest events and redraws the terminal when cursor is ready

Changes

  • Added TermRequest autocmd in Terminal:start() method
  • The autocmd triggers a terminal redraw by switching to the terminal window and using feedkeys
  • Autocmd is automatically deleted after triggering to avoid repeated redraws

@epheien
Copy link
Contributor Author

epheien commented Jan 14, 2026

{
  buf = 4,
  data = {
    cursor = { 1, 0 },
    sequence = "\27]11;?"
  },
  event = "TermRequest",
  file = "term://~/myconf//62305:opencode --port",
  id = 131,
  match = "term://~/myconf//62305:opencode --port"
}
{
  buf = 4,
  data = {
    cursor = { 1, 0 },
    sequence = "\27]66;w=1; "
  },
  event = "TermRequest",
  file = "term://~/myconf//62305:opencode --port",
  id = 131,
  match = "term://~/myconf//62305:opencode --port"
}
{
  buf = 4,
  data = {
    cursor = { 1, 0 },
    sequence = "\27]66;s=2; "
  },
  event = "TermRequest",
  file = "term://~/myconf//62305:opencode --port",
  id = 131,
  match = "term://~/myconf//62305:opencode --port"
}
{
  buf = 4,
  data = {
    cursor = { 1, 0 },
    sequence = "\27]4;0;?"
  },
  event = "TermRequest",
  file = "term://~/myconf//62305:opencode --port",
  id = 131,
  match = "term://~/myconf//62305:opencode --port"
}
{
  buf = 4,
  data = {
    cursor = { 25, 166 },
    sequence = "\27]12;#eeeeee"
  },
  event = "TermRequest",
  file = "term://~/myconf//62305:opencode --port",
  id = 131,
  match = "term://~/myconf//62305:opencode --port"
}

This is the event data of the TermRequest event when opencode -port is started.

@NickvanDyke
Copy link
Owner

NickvanDyke commented Jan 14, 2026

Nice, thank you for this fix! That was bothering me but I didn't have time to investigate. I'm curious if there might be a deeper underlying issue causing this. But it's an isolated and reliable workaround, so definitely still an improvement 🙂

@NickvanDyke NickvanDyke merged commit f0eabda into NickvanDyke:main Jan 14, 2026
2 checks passed
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