alias flushlog {
if (-* iswm $1) {
if (h isin $1) { var %flushlog.hide = $true }
if ($2 != $null) { var %flush.active = $2 }
else { var %flush.active = $active }
}
else {
if ($1 != $null) { var %flush.active = $1 }
else { var %flush.active = $active }
}
var %flush.path.1 = $window(%flush.active).logfile
var %flush.path.target = $gettok($nopath(%flush.path.1), 1, 46)
var %flush.path.2 = $mklogfn(%flush.path.target)
var %flush.color = $color(Info Text)
if ($isfile(%flush.path.1) == $true) {
.copy -a $qt(%flush.path.1) $qt(%flush.path.2)
if (!%flushlog.hide) {
echo %flush.color -atge * Flushed log: %flush.active
}
.remove $qt(%flush.path.1)
}
else {
if (!%flushlog.hide) {
echo %flush.color -atge * /flushlog: file not found
}
}
}