Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about tab naming... #395

Closed
DerellLicht opened this issue Dec 13, 2016 · 2 comments
Closed

Question about tab naming... #395

DerellLicht opened this issue Dec 13, 2016 · 2 comments
Labels

Comments

@DerellLicht
Copy link

I suspect I've asked about this before, but I can't find any notes on it.

I would like the tab to contain the current "path leaf" name (%D), except if I explicitly named the tab (usually via specific tab definitions in settings:tabs )

I am currently using:
?U([%D] ):(%D)
which gives me the current leaf directory name on each tab, regardless of what I specified settings:tabs:main

I then tried:
?t(%t):(?U([%D] ):(%D))
but that gives me... I don't know what... but not what I wanted.

Is there some way to do this??

@cbucher
Copy link
Owner

cbucher commented Dec 14, 2016

The syntax is explained in help file (see Using ConsoleZ/Text formatting).
?t(%t):(?U([%D] ):(%D)) displays the tab title if tab title is not empty; otherwise the current leaf directory.

Edit: (discussion has continued in #274)

Actually, using %d or %D is not recommended in tabs, because directory changement is not signaled. You must wait for another signal or select another tab to see the tab text refreshed with correct directory. I will check if there is a performance impact by adding this enhancement.

I think that modifying title from the shell is the best option (and workaround should be considered only in last resort). This is how most emulators work.
...
I installed tcc/le, read its manual and made some tests.

The easiest way is:

SET TITLEPROMPT=%%@FILENAME[%%@CWD[%%_disk:]]

And for more complex job, like displaying something different when I'm in a specific (sub)directory, you can also call a script:

SET TITLEPROMPT=%%@EXECSTR[c:\temp\test.bat]

And now you just have to configure tab title format like this:
?s(%s):(%t)

@DerellLicht
Copy link
Author

DerellLicht commented Dec 14, 2016 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants