Skip to content

[Bug] Multi-line input is split by line during history recall instead of being recalled as a whole #50

@Prodesire

Description

@Prodesire

Bug Description

When a user enters multi-line content (e.g., two lines of text with a newline) in iac-code and then exits the program, pressing the up arrow key (↑) to recall history after reopening iac-code only recalls one line at a time, instead of recalling the entire multi-line input as a single history entry.

Steps to Reproduce

  1. Run iac-code
  2. Enter multi-line content (e.g., two lines of text with a newline) and submit
  3. Exit iac-code (Ctrl+C or normal exit)
  4. Reopen iac-code
  5. Press the up arrow key (↑) to recall the previous input

Expected Behavior

Pressing the up arrow key should recall the previous multi-line input as a complete history entry, restoring the full multi-line content at once.

Actual Behavior

Pressing the up arrow key only recalls the last line of the multi-line input (or recalls line by line), instead of treating the entire multi-line input as a single history entry.

Operating System

macOS

Python Version

3.12.7

iac-code Version

0.3.0

Additional Context

This issue is likely related to how newline characters are handled when saving history. Multi-line inputs may be stored line-by-line in the history file, causing them to be treated as separate entries during recall.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions