You are not logged in.

#1 2022-06-02 07:45:31

Kraken66
Member
Registered: 2022-06-02
Posts: 4

[SOLVED] Bash terminal text sticking after history scrubbing

After scrubbing through the command history in bash quickly (holding down the up or down arrow keys), some text from a previous command gets "stuck" on the command line. This text cannot be deleted, the terminal treats this as part of the command prompt, and it doesn't affect the functionality of whatever command I run. For example, when pulling up a command form my history, I get this:

 $ date -ls -ahl 

Where "ls -ahl" is the command from my history that I want to run, and "date -" is a portion of some other command in my history I passed to reach my destination. While the terminal practically ignores this text, it still can be copied and pasted, interestingly enough. This issue persists across the kitty and alacritty terminal emulators, as well as the base shell that I get when I quit my WM. The stuck text does seem to go away when I shuffle around the windows in i3.

After verifying that it wasn't a problem with my terminal emulator, I thought it might be a graphics-related problem, although as far as I can tell, I have the correct graphics drivers installed for my RX 580 (lib32-mesa and xf86-amdgpu installed, lspci -k tells me the kernel driver is amdgpu). While it's totally likely that my graphics setup is wonky in some way, some of the attributes of this problem don't seem like they are exclusively graphics-related.

While it isn't really affecting functionality in any way, it is annoying to look at. Problem has been around for a few months at least. So far, googling has not yielded any results.

Any thoughts, or reading materials for me to look at?

Last edited by Kraken66 (2022-06-10 21:27:48)

Offline

#2 2022-06-03 07:13:56

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,573

Re: [SOLVED] Bash terminal text sticking after history scrubbing

While the terminal practically ignores this text, it still can be copied and pasted, interestingly enough. […] The stuck text does seem to go away when I shuffle around the windows in i3.

These two things don't add up.
If you can copy and paste the text, it cannot be a graphical artifact, but if "shuffling around windows" clears it, that very much suggests it is.
Or does the shuffle imply a window resize?
Can you reproduce the issue w/ xterm?

Offline

#3 2022-06-03 08:16:47

Kraken66
Member
Registered: 2022-06-02
Posts: 4

Re: [SOLVED] Bash terminal text sticking after history scrubbing

Did some more testing, the window shuffling only fixes it when I move it from one monitor to the other, or the window otherwise resizes it. I can reproduce this on xterm as well, seems just about any terminal I try has this issue.

This may or may not not be related, but I have been also having graphical issues when opening Firefox: it will sometimes open with the contents of the window shifted up, so the tab bar is off the screen. This is fixed by resizing the window, just as with the terminal, so it might be related.

While I agree that a graphics issue seems like a probable cause, I'm curious why the glitched text is selectable, copy and pastable, and will persist when scrolling around in the terminal. I'm no GPU expert, but these attributes seem outside the scope of what the graphics handle.

Regardless, it seems like I am in need of some graphics fixing anyways. As far as I can tell, I have the requisite drivers installed, but I've heard that getting graphics drivers working their best can be a bit of a process. So far googling has not yielded any results that are similar to what I'm seeing. Do you have any recomendations on what I should look in to?

Offline

#4 2022-06-03 12:19:46

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,573

Re: [SOLVED] Bash terminal text sticking after history scrubbing

At this point I'd rather look at your $PS1 (or maybe $PS2)

Offline

#5 2022-06-03 20:32:18

Kraken66
Member
Registered: 2022-06-02
Posts: 4

Re: [SOLVED] Bash terminal text sticking after history scrubbing

Yep, that was it. Turns out I messed around with my PS1 around the time that this issue started popping up, just didn't put two and two together. I replaced my PS1 with an example from the forum that I had more confidence of being correct, and the issue is gone! I was meaning to change around my PS1 again anyways, so this works out for the best.

Thanks for the help!

Offline

#6 2022-06-03 22:44:40

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,648

Re: [SOLVED] Bash terminal text sticking after history scrubbing

Please remember to mark your thread [SOLVED] (edit the title of your first post).

Offline

#7 2022-06-10 21:28:12

Kraken66
Member
Registered: 2022-06-02
Posts: 4

Re: [SOLVED] Bash terminal text sticking after history scrubbing

Whoops, sorry about that. Thanks for the reminder!

Offline

Board footer

Powered by FluxBB