Results 1 to 6 of 6

Thread: First several characters of terminal get "stuck"

  1. #1
    Join Date
    Oct 2020
    Beans
    5

    First several characters of terminal get "stuck"

    Hi,

    I've started getting a quite annoying bug on my terminal. The first few characters of the terminal seem to get stuck and I cannot `ctrl-l` or `clear` the from my screen. When I hit enter they get printed to the screen. Often this happens when I `ctrl-a` to the front of the line. Other times it gets worse and the terminal will print a newline for every character I type causing general corruption.

    Video attached showing the general behavior of the bug. https://imgur.com/a/iSBUEq6

    How can I go about debugging this? Please advise!

    System stats:
    OS: Ubuntu 22.04 LTS
    Host: XPS 15 9520
    Kernel: 5.15.0-39-generic
    Shell: bash 5.1.16

  2. #2
    Join Date
    Mar 2011
    Location
    U.K.
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: First several characters of terminal get "stuck"

    Try a different terminal to gather clues ..

    yakuake is one I use .. a dropdown terminal (F12 to toggle)

  3. #3
    Join Date
    Dec 2014
    Beans
    2,582

    Re: First several characters of terminal get "stuck"

    I see that you've got a really involved multi-line prompt that includes some colour emoji. Those are encoded as several bytes but put only one character on the screen. This might break the simple logic of the shell's display logic. Try a simpler prompt.

    Holger

  4. #4
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: First several characters of terminal get "stuck"

    Try
    Code:
    $ stty sane
    If that doesn't help, close the terminal program and open it again. Sometimes a program we run (accidentally or on purpose) will send control characters to the screen that changes things.
    "stty sane" will reset to reasonable defaults. However, when entering that command and option, it is likely that the displayed text won't look anything like what we are typing. That usually doesn't matter.

    If the prompt is really complex, that's likely the issue. The default prompt of
    {user}@{hostname}:{pwd}$ is brilliant. It is exactly what we need for rsync or scp to transfer files between systems. A little select/paste and by just using the current prompt, we've made something that could take 20 seconds into a 2second task.

    I use xterm - and have for about 25 yrs.

  5. #5
    Join Date
    Oct 2020
    Beans
    5

    Re: First several characters of terminal get "stuck"

    Alright, I switched to gnome-shell.

    Removed the emoji and simplified my prompt as recommend by @TheFu

    Using ``` stty sane``` I still get the behavior.

    Should I start removing recently install packages/programs that I think maybe interfering with the command line?

  6. #6
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: First several characters of terminal get "stuck"

    Quote Originally Posted by afollette View Post
    Alright, I switched to gnome-shell.
    Ouch. I'd never ask anyone to take that hardship on.

    Quote Originally Posted by afollette View Post
    Should I start removing recently install packages/programs that I think maybe interfering with the command line?
    I wouldn't expect any program would be screwing around with your command line, but if you use a non-standard shell, perhaps that is the issue?

    Might I suggest you return to the default prompt and see if that solves it? The easy way to test this is to create a new userid, login with it and see if the issue still happens. If not, then you know it isn't any installed program, but YOUR settings/environment.

    People often forget that creating and removing userids is pretty trivial. Linux is multi-user, all the way down to the core. I have different users on my systems for different needs, mostly testing, but also for other needs. If I completely clear the $HOME directory, including all the ~/.directory/ files there, I know it is a fresh user.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •