Re: How to add environment variable value to hardstatus line

Neal Fultz <[email protected]>
Newsgroups gmane.comp.gnu.screen.user
Message-ID <CAL9B2vf9u+B2J8nkYxq6gOhpQNvzAbqfpK6KsHG-T=qhczW+AA@mail.gmail.com>
I do something similar, I use the following in my screenrc to set the title
to current dir:

 setenv PROMPT_COMMAND 'echo -ne "\033_`pwd`\033\\"'

Then you can use %t in the status bar or wherever.

On Wed, Mar 11, 2015 at 2:04 PM, Shigehiko SASAKI <[email protected]>
wrote:

> Hi Mario
>
> you can output escape sequence string to virtual terminal,
> so as to display any messages you like in hardstatus line.
>
> bash has some convenient features PROMPT_COMMAND or PS1
> to execute any commands before displaying shell prompt message.
>
> for example to display $(envname) in hardstatus line
> [[.bashrc]]
> # send message to screen hardstatus %h
> if [[ "$TERM" =~ "screen" ]]; then
>   PROMPT_COMMAND='echo -ne "\033k\033\0134\033k$(envname)\033\\"'
> endif
>
> // Shige
>
> _______________________________________________
> screen-users mailing list
> screen-users-mXXj517/[email protected]
> https://lists.gnu.org/mailman/listinfo/screen-users
>

_______________________________________________
screen-users mailing list
screen-users-mXXj517/[email protected]
https://lists.gnu.org/mailman/listinfo/screen-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.