You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: message history restoration corrupts text with attachments #1266
When navigating message history using the "Up" arrow key, messages containing attachments and line breaks become corrupted, resulting in duplicated attachment paths within the text.
Reproducing the issue
Steps to reproduce
Start the TUI.
Type a message with a line break and an attachment like the example below.
Send the message.
Press the "Up" arrow key to navigate to the previous message in history.
read this:
@path/to/my/file.txt
Expected result: I expect to see the same text.
Actual result: the message text becomes corrupted with duplicated attachment paths.
read this:
@path/to/m@path/to/my/file.txt
Technical analysis
Disclaimer: the text below was done with the help of an LLM agent.
The issue appears to be in the RestoreFromHistory function in editor.go around line 632. The function:
Restores the text via m.textarea.SetValue(entry.Text)
Processes attachments by replacing text ranges and inserting attachment objects
The range replacement logic may be incorrectly calculating indices when dealing with multi-line text
Activity
rekram1-node commentedon Dec 28, 2025
[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!