Problem with overlapped terminal

Questions, glitches, bugs and crashes
Locked
achekulaev
Posts: 50
Joined: Sat Jul 25, 2015 1:04 am

Problem with overlapped terminal

Post by achekulaev » Mon Sep 14, 2015 3:04 pm

Here were some incorrect assumptions. Please see further for details of my investigation...
Last edited by achekulaev on Mon Sep 14, 2015 9:50 pm, edited 2 times in total.

achekulaev
Posts: 50
Joined: Sat Jul 25, 2015 1:04 am

Re: Problem with multiline PS1

Post by achekulaev » Mon Sep 14, 2015 9:20 pm

So it does not completely break things. But severely. Not sure if it's related to multiline now.

Here is video:
https://dl.dropbox.com/s/2oolw3wcxz921i ... d.mp4?dl=0

Sometimes I'm unable to change dir in 5+ "enter"-s.
Last edited by achekulaev on Mon Sep 14, 2015 9:23 pm, edited 1 time in total.

achekulaev
Posts: 50
Joined: Sat Jul 25, 2015 1:04 am

Re: Problem with multiline PS1

Post by achekulaev » Mon Sep 14, 2015 9:23 pm

It only happens when I have 1 or more lines of overlapped terminals visible. When they are hidden - everything is fine.

achekulaev
Posts: 50
Joined: Sat Jul 25, 2015 1:04 am

Re: Problem with overlapped terminal

Post by achekulaev » Mon Sep 14, 2015 9:50 pm

So I figured out what it is. Files terminals start to glitch because of 2 reasons
1) I have custom function in my PS1. Here is piece of my .bashrc
It outputs git branch of current directory

Code: Select all

__git_ps1 () 
{ 
    local b="$(git branch 2>/dev/null | grep \*)";
    if [ -n "$b" ]; then
            printf " (git:%s)" "${b:2}";
    fi
}

PS1="\t\[\033[01;31m\] \h\[\033[01;34m\] \$PWD\$(__git_ps1)\n\[\033[00m\]\$ "
2) In directories which do contain git repository this function takes some time to execute (of course). Looks like Files doesn't wait for it to finish

User avatar
mike
Posts: 1060
Joined: Thu Jul 16, 2015 5:35 am
Location: Exeter, UK

Re: Problem with overlapped terminal

Post by mike » Wed Sep 16, 2015 6:56 am

achekulaev,
It looks like a timing stuff, indeed.
Currently there're some hardcoded timing values in overlapped variant of terminal, one of them seem to cause this behaviour:
10ms for Bash to print it's welcome after COMMAND_PROMPT was executed, in your case it may took some longer time.
I'll try to change logic a bit, so it won't be violated by long waiting for a Bash welcome.
I'll dig into it after non-uniform listings support (search results etc) became somewhat mature.

Locked