zsh, mc and precmd



Hi everyone,

I just wanted to share a small tip that took me quite a long time to find. 
It's not exactly related with mc itself, but mc definately was the source of 
my (now solved) problems.

My shell is zsh and I used to do *lots* of things in its precmd() function to 
get my prompt, change the Konsole tab's name, etc. The only issue was that mc 
redefines precmd() in its subshell, hiding mine and leading to some unwanted 
text in Konsole's tab.

The solution was to define a list named precmd_functions¹ in my zshrc file, 
with the name of each function I want to be called in the precmd context.

The functions in the list seem to be called before the "real" precmd() which 
means it doesn't break mc's subshell since the "kill -STOP $$" is still 
executed right before showing the prompt.

As I couldn't find any hint on this when googling for mc, zsh and precmd, I 
thought I'd share it with the list, in the hope it'll be archived and 
indexed.


Cheers,

¹) Just in case you wondered, yes, similar lists are available for preexec and 
chpwd as well.

-- 
Amand Tihon
Rue du Ruchaux, 1 - 1490 Court-St-Etienne, Belgique
+32 479 207 743

Attachment: signature.asc
Description: This is a digitally signed message part.



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