M
M
moskrc2012-09-27 14:47:31
bash
moskrc, 2012-09-27 14:47:31

When you start MC, the size of the .bash_history file is immediately reduced (past entries are deleted)

Good afternoon!

Tell me how to make friends Midnight Commander and .bash_history. If you run mc, then immediately the size of .bash_history is reduced to 8kb. All the history that did not fit into these 8kb is deleted ... That's such a horror.

How to repeat:

$ du -h .bash_history
 44K	.bash_history
$ mc
$ du -h .bash_history
8,0K	.bash_history


My ~/.profile

export HISTCONTROL=ignoredups,ignoreboth
export HISTTIMEFORMAT="%d/%m/%y %T "
export HISTSIZE=
export HISTFILESIZE=

OSX Mountain Lion 10.8.2

[email protected] ~ $ bash --version GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin12)

[email protected] ~ $ mc --version GNU Midnight Commander , version 4.8.3

Thanks

Answer the question

In order to leave comments, you need to log in

6 answer(s)
M
moskrc, 2012-09-28
@moskrc

Solution: add lines from .profile to .local/share/mc/bashrc.

E
EaS, 2012-09-27
@EaS

I'm not sure, but I don't think mc is reading .bashrc. Accordingly, if you specify a history file size in it that is larger than what mc works with, then the file will be truncated. But that's just a guess :)

S
smartly, 2012-09-27
@smartly

And if you run /usr/bin/mc? (or where mc is put in makosi)

A
Alexander Lebedev, 2012-09-28
@cawaleb

Look in the system, what is the mc that is running, maybe it's a script?
I tried it myself:
$ll ~/.bash_history
-rw-------. 1 oracle cawa 42901 Sep 28 03:25 /home/cawa/.bash_history
$mc
$ll ~/.bash_history
-rw-------. 1 oracle cawa 42901 Sep 28 03:25 /home/cawa/.bash_history
System info:
$cat /etc/fedora-release
Fedora release 16 (Verne)
$bash --version
GNU bash, version 4.2.28(1)-release (i386-redhat-linux-gnu)
$mc --version
GNU Midnight Commander 4.8.3

M
moskrc, 2012-09-28
@moskrc

$ file /usr/local/bin/mc
/usr/local/bin/mc: Mach-O 64-bit executable x86_64
$ du -sh .bash_history
 12K	.bash_history
$ /usr/local/bin/mc

$ du -sh .bash_history
8,0K	.bash_history

:(

S
smartly, 2012-09-28
@smartly

Well, then I would run mc through strace (if there is an analogue in the macos) and look at the log, whether it climbs to this file or not.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question