Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When used in vscode there are strange duplicates #12723

Open
Arteiimis opened this issue May 1, 2024 · 3 comments
Open

When used in vscode there are strange duplicates #12723

Arteiimis opened this issue May 1, 2024 · 3 comments
Labels
line editor Issues related to reedline needs-triage An issue that hasn't had any proper look

Comments

@Arteiimis
Copy link

Describe the bug

When used in vscode, opening a terminal and pressing the esc key results in the first line being duplicated

How to reproduce

likethis:

20240501_232914.mp4

Expected behavior

nothing should happend when press esc.

Screenshots

No response

Configuration

| key                | value                                                      |
| ------------------ | ---------------------------------------------------------- |
| version            | 0.93.0                                                     |
| major              | 0                                                          |
| minor              | 93                                                         |
| patch              | 0                                                          |
| branch             | main                                                       |
| commit_hash        | 3c022e334fc81d43fe395c5c8c0825b45a3b8d0b                   |
| build_os           | windows-x86_64                                             |
| build_target       | x86_64-pc-windows-msvc                                     |
| rust_version       | rustc 1.77.2 (25ef9e3d8 2024-04-09)                        |
| rust_channel       | 1.77.2-x86_64-pc-windows-msvc                              |
| cargo_version      | cargo 1.77.2 (e52e36006 2024-03-26)                        |
| build_time         | 2024-04-30 18:09:28 -07:00                                 |
| build_rust_channel | release                                                    |
| allocator          | mimalloc                                                   |
| features           | dataframe, default, sqlite, system-clipboard, trash, which |
| installed_plugins  |                                                            |

Additional context

No response

@Arteiimis Arteiimis added the needs-triage An issue that hasn't had any proper look label May 1, 2024
@sholderbach sholderbach added the line editor Issues related to reedline label May 3, 2024
@Arteiimis
Copy link
Author

After testing, almost all oh-my-posh prompts that are multiline have this problem, while single-line ones do not

@NicolasGB
Copy link

Hey, having the exact same issue on Wezterm, started using nushell and found that on the first prompt after opening the terminal the prompt duplicates.
If i can help providing more information let me know

@cpg314
Copy link

cpg314 commented May 18, 2024

Similar issue with wezterm.
On terminal opening
image
After typing one letter:
image
So it looks like the initial width is not properly determined.

If I do the following three changes in my starship configuration, then the problem is gone:

# right_format="$time"
add_newline = false
[line_break]
disabled = true

This is what starship is doing:

            ^/usr/bin/starship prompt
                --cmd-duration $env.CMD_DURATION_MS
                $"--status=($env.LAST_EXIT_CODE)"
                --terminal-width (term size).columns

However, changing --terminal-width to a hardcoded value does not make a difference.

Disabling starship, I see a similar issue with the default prompt:
image
Presser one key
image
The right part gets moved to the edge of the window, although there is no line/prompt duplication.

The problem is gone if I make nushell wait a very short while on starup:

   default_prog = { '/usr/bin/nu', '-e', 'sleep 0.05sec' },

Interestingly:

   default_prog = { '/usr/bin/nu', '-e', 'sleep 0.1sec; term size' },

prints

╭─────────┬─────╮
│ columns │ 104 │
│ rows    │ 51  │
╰─────────┴─────╯

while

   default_prog = { '/usr/bin/nu', '-e', 'term size' },

prints

╭─────────┬────╮
│ columns │ 80 │
│ rows    │ 24 │
╰─────────┴────╯

With a sleep of 0.05 seconds, the width alternates randomly between 80 and 104.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
line editor Issues related to reedline needs-triage An issue that hasn't had any proper look
Projects
None yet
Development

No branches or pull requests

4 participants