Tiny Core Extensions > TCE Bugs
piCore 8.x - .ash_history spammed by Midnight Commander
(1/1)
Misalf:
Using Midnight Commander on piCore 8.x creates lots of quite useless entries like the following in .ash_history .
--- Code: ---precmd() { if [ ! "${PWD##$HOME}" ]; then MC_PWD="~"; else [ "${PWD##$HOME/}" = "$PWD" ] && MC_PWD="$PWD" || MC_PWD="~/${PWD##$HOME/}"; fi; echo "$USER@$(hostname -s):$MC_PWD"; pwd>&6; kill -STOP $$; }; PRECMD=precmd; PS1='$($PRECMD)$ '
--- End code ---
Does anyone know how to prevent / fix this?
BTW, .bash_history is not affected.
bmarkus:
I can't reproduce, both tc and root history is clean on my development system and on a new installation. Please delete your history, make a backup and watch for it. If appears again, try to identify steps caused it.
Thanks!
patrikg:
Could MC add these when you pressing <CTRL><O>.
To switch between the MC and Shell.
Rich:
Hi Misalf
I've just set up TC15 x86_64 and Midnight Commander
is spamming my .ash_history file too.
I came up with a couple of fixes.
Adding this to .profile fixes mc when started from the command line:
--- Code: ---# Stop Midnight Commander from spamming the command history files.
alias mc='env HISTFILE=/dev/null mc'
--- End code ---
A file placed in .X.d containing this fixes mc when started from the pop up menu:
--- Code: ---# Fix the desktops popup menu.
[ -f ~/.wmx/Applications/mc ] && echo -e "#!/bin/sh\nenv HISTFILE=/dev/null xterm -e mc" > ~/.wmx/Applications/mc
--- End code ---
Adding these lines to that file fixes the wbar icon:
--- Code: ---# Fix the wbar icon.
DESKTOP="/usr/local/share/applications/mc.desktop"
# Replace the link with a file so we can edit it.
[ -L "$DESKTOP" ] && sudo busybox cp "$(readlink "$DESKTOP")" "$DESKTOP"
[ -f "$DESKTOP" ] && sudo sed -i 's|^Exec=.*|Exec=~/.wmx/Applications/mc|' "$DESKTOP"
[ -f "$DESKTOP" ] && wbar_rm_icon mc
[ -f "$DESKTOP" ] && wbar_update.sh mc
--- End code ---
I've attached a copy of the file I placed in .X.d in case
anyone else runs into this problem.
These commands get run automatically when X starts.
If you install mc after X starts, you can run the file like this:
--- Code: ---chmod 775 .X.d/FixMC
./.X.d/FixMC
--- End code ---
Restart any running instances of mc and the spamming will stop.
Navigation
[0] Message Index
Go to full version