Conemu: Tab template for current directory name

Created on 7 Mar 2015  路  21Comments  路  Source: Maximus5/ConEmu

@Maximus5, is there a tab template for current directory name vs the full directory path? This would be very useful for users who use ConEmu on several folders at the same time using a single window and multiple tabs.

Most helpful comment

Let's say I am on directory C:\test\one\two\three\four\and\my-project-name.

If I use the tab template : <%c> %d

I get <1> C:\test\one\two\three\four\and\my-project-name.

Anyway to get <1> my-project-name?

capture

All 21 comments

What do you mean?

Let's say I am on directory C:\test\one\two\three\four\and\my-project-name.

If I use the tab template : <%c> %d

I get <1> C:\test\one\two\three\four\and\my-project-name.

Anyway to get <1> my-project-name?

capture

Hahahaha... You are awesome my friend. Just got the update. Works great!

I don't get it. For me, it still shows the full path, rather than the basename (last part of the path)

@gene-pavlovsky Just look carefully in your configuration dialog.

@Maximus5 Well I replaced %s with %d, what else is there to look at? It doesn't have effect on Far at all (and setting %d in Far settings didn't work either). I'm mostly using Cygwin bash, my PROMPT_COMMAND includes a call to ConEmuC -StoreCWD.

You shall read description for tab temlate field! %d is not a template you are looking for.

The OP posted a screenshot using %d followed by Works great! comment and then the issue was closed. What is the solution, then? Please point me to the full list of available tab template field patterns. I didn't find anything relevant here.

The screenshot shows template for "directory path", what was requested.
Is it so hard to read description near to the template field to get %f - folder?

@Maximus5, sorry to steal your time with my questions.
To be honest, there's no %f in the screenshot, and that's where I looked. Now I see in settings themselves there's %f (but it's not mentioned on the Far manager's page).
It seems to work half of the times - sometimes it doesn't update. So I changed drive from C:\ to D:\, didn't update. Entered a dir, updated. Entered a subdir in that dir, not updated. Entered another subdir, updated.

Same issue if I use ConEmuC -GuiMacro Rename 1 "$PWD" instead of Rename 0 in bash's PROMPT_COMMAND. Should I open another github issue?

Screenshot was not posted by me and I tried to force you to check your settings dialog.

Without thorough information about OS, shell, prompt configuration, ConEmu version and probably something else I can't find your problem with jammed folder in title.

Sorry for misunderstanding. Right, I posted another issue about Far with more details. Problem in bash was unrelated. That issue was due to:

19:13:59 /proc
# ConEmuC -GuiMacro Rename 1 "$PWD"
Error: Current working directory is a virtual Cygwin directory which does
not exist for a native Windows application.
Can't start native Windows application from here.

Same happens with /cygdrive. Small price to pay, I guess.

I suppose, you may correct PROMPT_COMMAND and suggest an improvement.

Anyway, I hate /cygdrive.

I renamed mine to /mnt through fstab. If I would be running Linux, that's where Windows filesystems would be mounted.
Anyway /dev and below, /proc and below and exactly /cygdrive (/mnt in my case) are the places which don't map anywhere within Windows world (e.g. can't open Far pointing there), I have no idea what to update the CWD to. Just change the tab title to the current path?
Btw, if I change the tab title with ConEmuC -GuiMacro Rename 0 "title", what should I do to reset it to the default tab title template (e.g. %c %d)?

Empty string would revert to default tab title.

Genius! Could have guessed it :)

@Maximus5 I don't know why, but on my machine %f shows my user name. Here is my directory:
guilherme.ferruzzi@MLW153 MINGW64 /C/Users/guilherme.ferruzzi/PhpstormProjects/vue-bills-api (master)
But in tabs: %f shows guilherme.ferruzzi

Different process on the same folder shows:
%n - %f = node.exe - guilherme.ferruzzi, php.exe - guilherme.ferruzzi, bash.exe - guilherme.ferruzzi
I would like it to be node.exe - vue-bills-api

image

@gpressutto5 RTFM: Shell working directory

@Maximus5 Works great! :heart:

@Maximus5, just a note: The "Far manager" page in Settings does not mention %d and %f, but I was happy to find that they work! Thanks!

I have a suggestion also: In case of Far manager it would be useful to have another code (%F or similar) also for returning the current folder for the inactive panel.

Was this page helpful?
0 / 5 - 0 ratings