screen-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Get current window title in bash


From: Иванов Дмитрий
Subject: Get current window title in bash
Date: Wed, 9 Feb 2022 11:09:29 +0300

My goal is to print the current window title in bash prompt. Currently I
know $WINDOW environment variable that contains the number of the
currently selected window.

I learned about "screen -Q title" command but 2 problems emerged:

1. This command is slow and makes a delay when used in .bashrc.
2. When I tried this code:

if [ -n "$STY" ]; then
    TITLE=$(screen -Q title)
    PS1=$PS1"\[\033[01;93m\]$TITLE "
fi

It shows the title in the prompt and I have to click extra Enter key. Is
it possible to get the name quickly?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]