add console support on windows.fix little bug.add viewall support