5

Every time I work in the console I use GNU Screen. I have a custom .screenrc file with several settings. Among others I have the setting that shows 'tabs' in the bottom:

hardstatus alwayslastline
hardstatus string "%{= g} %{= w}%-w%{=r}%n %t%{-}%+W"

It works well, but I want to add to the tabs some symbol that shows what tab was previously active. How can this be done?

Teun Zengerink
  • 4,277
  • 5
  • 30
  • 32
bessarabov
  • 11,151
  • 10
  • 34
  • 59

2 Answers2

5

You can use can use following string:

hardstatus string "%{= g} %{= w}%-Lw%{=r}%n%f* %t%{-}%+LW"

Than window with focus will be marked with symbol '*' and previous one - with '-'.

Andrey Starodubtsev
  • 5,139
  • 3
  • 32
  • 46
  • Thank you! It is great but it does not exactly what I need. I tried to figure out myself how to fix it, but I failed. 1) There is some '$' symbol after every tab number that are not needed 2) the symbols '*' and '-' make the tab one symbol wider and because of that the tabs jumps a little. I think it can be solved by placing space if there is no '*' and '-' symbols. 3) The symbol '*' is not needed because there is also a color selection of the current tab. – bessarabov Feb 27 '12 at 08:20
5

Alas, comments support only a bit of formatting abilities, so i created a new answer.

1) There is some '$' symbol after every tab number that are not needed

With hardstatus string "%{= g} %{= w}%-Lw%{=r}%n%f* %t%{-}%+LW" i can't see any '$':

enter image description here

2) the symbols '' and '-' make the tab one symbol wider and because of that the tabs jumps a little. I think it can be solved by placing space if there is no '' and '-' symbols.

Alas, all tabs besides selected are not configured - they are just shown if %w ( all windows including current ) or %W ( all windows except current ) are used in hardstatus string. These escapes can be prepended with - or + ( to show windows before or after current one ) and L ( to show window's flags ). Spaces, or formatting, or content of these parts of line can't be configured - they have only tab's number, title and optionally flags with fixed indents.

3) The symbol '*' is not needed because there is also a color selection of the current tab.

Sure, you can replace * with space after %f in hardstatus string with two spaces ( sorry for strange sentence, but SO text engine eats spaces in backticks weirdly ) - but without adjusting spaces after tab's number for non-active and non-last tabs they continue "to jump".

Andrey Starodubtsev
  • 5,139
  • 3
  • 32
  • 46