Skip to content

[BUG]: auto-close-chars fails to over-write with ']' square bracket #815

Closed

Description

@todated

Describe the Bug

i found a test in the code (which is passing), for echo [] ;
however when i echo [x] and then type the final ] then it duplicates the ] closing square bracket char.
this does not happen with ) rounded/parens nor } curly/braces.

also, echo [x followed by 2x backspaces fails to remove the auto-inserted ] closing square bracket, but that case works correctly for the other other two type of bracket (and two types of quote chars).

Environment & Version Information

flyline 1.3.0
git hash: 339e8bf
build mode: debug
build datetime: 2026-07-13T07:13:16Z
build target: x86_64-unknown-linux-gnu
rustc version: rustc 1.93.1 (01f6ddf75 2026-02-11)

Running in: Bash 5.3.0(1)-release
shell: /usr/local/bin/bash

Running in: xterm-ghostty
program: ghostty
program version: 1.3.1
locale: en_US.UTF-8 (LC_ALL: unknown, LC_CTYPE: unknown)

Running in: Ubuntu 24.04.4 LTS (kernel 6.17.0-40-generic x86_64)
system linker: GNU ld (GNU Binutils for Ubuntu) 2.42
dynamic linker: unknown

Running on: 13th Gen Intel(R) Core(TM) i7-1360P (16 cores)

Running in: a simulation

Debug Logs (Optional / If Necessary)

Click to expand logs
2026-07-16T17:08:40.619747 [DEBUG] (pid=23734) src/app/mod.rs:250: Final state: WithoutCommand
2026-07-16T17:08:40.619885 [INFO] (pid=23734) src/lib.rs:253: ---------------------- App finished ------------------------
2026-07-16T17:08:40.621384 [INFO] (pid=23734) src/lib.rs:185: ---------------------- Starting app ------------------------
2026-07-16T17:08:40.622297 [DEBUG] (pid=23734) src/prompt_manager.rs:1370: Animation count: 1
2026-07-16T17:08:40.622328 [DEBUG] (pid=23734) src/prompt_manager.rs:1377: Widget count: 2
2026-07-16T17:08:40.623178 [INFO] (pid=23734) src/bash_funcs.rs:425: Getting cached reserved words
2026-07-16T17:08:40.626202 [INFO] (pid=23734) src/app/mod.rs:426: Warming thread finished in 3.868832ms
2026-07-16T17:08:40.626246 [DEBUG] (pid=23734) src/prompt_manager.rs:1380: CWD for prompt detection: "/home/chdavis", HOME: Some("/home/chdavis")
2026-07-16T17:08:40.626513 [DEBUG] (pid=23734) src/prompt_manager.rs:1404: Parsed RPS1: [[], [Static(Span::from("|").fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).dim().not_bold().not_italic().not_underlined().not_slow_blink().not_rapid_blink().not_reversed().not_hidden().not_crossed_out())]]
2026-07-16T17:08:40.636450 [DEBUG] (pid=23734) src/history.rs:87: Loaded 8739 bash history entries
2026-07-16T17:08:40.636498 [DEBUG] (pid=23734) src/history.rs:89: bash_entries => HistoryEntry { timestamp: Some(1784214509), index: 8738, command: "flyline log set-level debug", raw_output: None, syntax_highlighted: OnceCell(<uninit>) }
2026-07-16T17:08:40.636520 [DEBUG] (pid=23734) src/history.rs:89: bash_entries => HistoryEntry { timestamp: Some(1784214362), index: 8737, command: "flyline version --copy", raw_output: None, syntax_highlighted: OnceCell(<uninit>) }
2026-07-16T17:08:40.636535 [DEBUG] (pid=23734) src/history.rs:89: bash_entries => HistoryEntry { timestamp: Some(1784214358), index: 8736, command: "flyline --version --copy", raw_output: None, syntax_highlighted: OnceCell(<uninit>) }
2026-07-16T17:08:42.325709 [INFO] (pid=23734) src/app/auto_close.rs:56: Inserted auto-closing char ']' at byte position 6
2026-07-16T17:08:45.418207 [DEBUG] (pid=23734) src/app/mod.rs:250: Final state: WithoutCommand
2026-07-16T17:08:45.418281 [INFO] (pid=23734) src/lib.rs:253: ---------------------- App finished ------------------------
2026-07-16T17:08:45.419617 [INFO] (pid=23734) src/lib.rs:185: ---------------------- Starting app ------------------------
2026-07-16T17:08:45.421583 [INFO] (pid=23734) src/bash_funcs.rs:425: Getting cached reserved words
2026-07-16T17:08:45.426862 [INFO] (pid=23734) src/app/mod.rs:426: Warming thread finished in 6.265379ms
2026-07-16T17:08:45.426894 [DEBUG] (pid=23734) src/prompt_manager.rs:1370: Animation count: 1
2026-07-16T17:08:45.426930 [DEBUG] (pid=23734) src/prompt_manager.rs:1377: Widget count: 2
2026-07-16T17:08:45.426954 [DEBUG] (pid=23734) src/prompt_manager.rs:1380: CWD for prompt detection: "/home/chdavis", HOME: Some("/home/chdavis")
2026-07-16T17:08:45.427273 [DEBUG] (pid=23734) src/prompt_manager.rs:1404: Parsed RPS1: [[], [Static(Span::from("|").fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).dim().not_bold().not_italic().not_underlined().not_slow_blink().not_rapid_blink().not_reversed().not_hidden().not_crossed_out())]]
2026-07-16T17:08:45.436608 [DEBUG] (pid=23734) src/history.rs:87: Loaded 8739 bash history entries
2026-07-16T17:08:45.436659 [DEBUG] (pid=23734) src/history.rs:89: bash_entries => HistoryEntry { timestamp: Some(1784214509), index: 8738, command: "flyline log set-level debug", raw_output: None, syntax_highlighted: OnceCell(<uninit>) }
2026-07-16T17:08:45.436683 [DEBUG] (pid=23734) src/history.rs:89: bash_entries => HistoryEntry { timestamp: Some(1784214362), index: 8737, command: "flyline version --copy", raw_output: None, syntax_highlighted: OnceCell(<uninit>) }
2026-07-16T17:08:45.436698 [DEBUG] (pid=23734) src/history.rs:89: bash_entries => HistoryEntry { timestamp: Some(1784214358), index: 8736, command: "flyline --version --copy", raw_output: None, syntax_highlighted: OnceCell(<uninit>) }
2026-07-16T17:08:49.156937 [INFO] (pid=23734) src/app/mod.rs:756: Exiting with command: flyline log copy --last 10s
2026-07-16T17:08:49.158281 [DEBUG] (pid=23734) src/app/mod.rs:250: Final state: WithCommand("flyline log copy --last 10s")
2026-07-16T17:08:49.158360 [INFO] (pid=23734) src/lib.rs:253: ---------------------- App finished ------------------------
2026-07-16T17:08:49.177666 [DEBUG] (pid=23734) src/cli.rs:954: flyline called with args: ["log", "copy", "--last", "10s"]
2026-07-16T17:08:49.180692 [DEBUG] (pid=23734) src/cli.rs:961: Parsed flyline arguments: FlylineArgs { version: false, load_zsh_history: None, show_animations: None, matrix_animation: None, frame_rate: None, mouse_mode: None, send_shell_integration_codes: None, enable_extended_key_codes: None, command: Some(Log { subcommand: Copy { last: Some("10s") } }) }

Steps to Reproduce

  • type echo (x) -- this over-writes the closing ) correctly
  • type echo [] -- this over-writes the closing ] correctly
  • type echo [x] -- this fails to over-write; it duplicates the ]

Activity

  1. added
    bug
    on Jul 16, 2026
  2. HalFrgrd commented on Jul 31, 2026

    @HalFrgrd
    Owner

    Thanks for making the issue! I think the lexer will need updating to fix it

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions