FlushEnvironment function

better listchar setting