Skip to content

marslo/myColorfulWinCommandLine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Colorful_CommandLine_Windows

The configuration about windows command line

Truth:

Content

Default Command Line

Colorful prompt

Needed Tools and files:

  • Ansicon
  • A bat file

Steps:

  • ANSICON:

    • Download Ansicon from HomePage or GitHub
    • Install:
      > cd ansi161\x86\
        > ansicon.exe -i
        
  • Create bat file:

    • Characters help by using :

      > prompt /?
        
    • Example (run.bat):

      @echo
        prompt $E[1;31m$d$E[1;32m$s$t$s$E[1;31m$g$g$s$E[0;33m
        
  • Add bat file into Regedit:

    • Open Regedit: Ctrl + R -> regedit
    • Path: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor
      Type:             String
        Value Name:       AutoRun
        Value Data:       [Path_Of_Bat_file]
        
    • By Command:
      c:\ > reg add "HKLM\SOFTWARE\Microsoft\Command Processor" /v AutoRun /t REG_SZ /d "%WINDIR%\run.bat"
    • E.g.: Command_porcessor

Change Font in CommandLine

Add the customize Font

  • Go to: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont
  • Create Font Type:
    • Type: String
    • Key Name: Only defined by '0' (zero)
      E.g.: '0', '00', ... , '00..0'
        
    • Key Value: Font Name (Only monospace series) E.g.:
      '000'    =>   Monaco
        '0000' =>    Courier New
        ...
        
    • By command:
    c:\> reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont" /v "0000" /t REG_SZ /d "Consolas" /f
      
    • E.g.: Font

Set code page

  • Running in command line: (or chcp 850)
    > chcp 437
      
  • Code page regist location: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage

Settings:

  • Right-Click -> Propties -> Font
  • E.g.: propties

Specified the cursor size:

Configure by Manual

  • Open regedit by Win + R -> Input regedit
  • Go to HKEY_CURRENT_USER -> Console
  • Add keyword:
    "CursorSize"=dword:00000006
  • For Example:
    [HKEY_CURRENT_USER\Console]
      "CursorSize"=dword:00000006
      [HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe]
      "CursorSize"=dword:00000006
      

Configure by Command

c:\> reg add "HKCU\Console" /v CursorSize /t REG_DWORD /d "1" /f

Set aliases in Command Line(Default Command Line)

  • Create .cmd file (E.g.: %WINDIR%\alias.cmd)
    • It can be copied from folder *Default_CommandLine\Aliases*
  • Add the full file path into regist: HKEY_CURRENT_USER\Software\Microsoft\Command Processor
    • CMD command:
      c:> reg add "HKCU\SOFTWARE\Microsoft\Command Processor" /v AutoRun /t REG_SZ /d "%WINDIR%\alias.cmd"
      

Configuration about Console/Console2:

  • Copy the console.xml to %APPDATA%\Console folder
  • If the console is from pythonxy
    • Copy pythonxy\console\ to $PYTHONXYHOME\console.
    • For example, copy it to C:\pythonxy\console\

Tabs in pythonxy console:

  • Tab1: Marslo - IPython (sh)
  • Tab2: Marslo - Ipython (Qt)
  • Tab3: Python
  • Tab4: Command Line
  • Tab5: IPython (sh) [Original]
  • Tab6: Ipython (Qt) [Original]

Shortcut

  • ctrl + s: Open setting dialog
  • Ctrl + F1: Open Tab1
  • Ctrl + F<N>: Open Tab<N>
  • Ctrl + 1: Switch to Tab1
  • Ctrl + <N>: Switch to Tab<N>

Mouse setting

  • Left + Shift: Copy/clear selection
  • Left + Ctrl: Drag window
  • Left: Select text
  • Right: Paste text

Configuration about TCC/LE:

  • Copy the tcstart.btm to %PROGRAMFILES%\JPSoft\TCCLE13

Configuration

  • Open profile file:
    > gvim $PROFILE
  • Set cursor size:
    [Console]::CursorSize = 6
      $HOST.UI.RawUI.CursorSize = 6
      
  • List all files:
    function la
      {
          $currentpath = Get-Location
          Get-ChildItem $currentpath -force
      }
      
  • List all hidden file (start with ".")
    function l.
      {
          # Get-ChildItem . -Force | Where-Object { $_.Attributes -like "*Hidden*" } | Select FullName
          Get-ChildItem . -Force | Where-Object { $_.Attributes -like "*Hidden*" }
      }
      
  • Tree
    function tree
      {
          $currentpath = Get-Location
          Get-ChildItem $currentpath -recurse
      }
      
  • Go to some path
    function prog
      {
          Set-Location "C:\Program Files"
      }
      
  • Cat some content
    function alias
      {
         Get-Content "c:\WindowsPowerShell\aliases_Marslo.txt"
      }
      

Some tips

  • Profile issue:
    • Problem:
      Microsoft.PowerShell_profile.ps1 cannot be loaded
    • Fix method:
    > Set-ExecutionPolicy -ExecutionPolicy Unrestricted
      > Get-ExecutionPolicy
      > Get-ExecutionPolicy -list
      

Configuration about Ansicon:

Brief Introduction:

  • 3x and 4x:
    • 3x: Front Color
    • 4x: Background Color
  • Basic format:$E[a;3b;c;4dm or $E[0;a;3b;c;4dm
    • For example:
      • $E[31;46m: Front color: dark red; Background color: dark green ( == $E[0;31;46m == $E[0;31;6;46m)
      • $E[1;31;46m: Front color: light red; Background color: dark green ( == $E[1;31;1;46m)
      • $E[1;31;4;46m: Front color: light red; Background color: light green
    • a (control dark/light front color):
      • 0 == a: Set the dark front color
      • 1 == a: Set the light front color
      • 7 == a: Reversal the front color and background color
    • b (front color):
      • 1: Red
      • 2: Green
      • 3: Yellow
      • 4: Blue
      • 5: Magenta
      • 6: Cyan
      • 7: White
    • c (control dark/light/reversal background color):
      • 0 == c: Set front color as dark white
      • 4 == c: Set light background color
      • 1 or 6 == c: Set dark background color
      • 7 == c: Reversal the front color and background color
    • d (background color):
      • 1: Red
      • 2: Green
      • 3: Yellow
      • 4: Blue
      • 5: Magenta
      • 6: Cyan
      • 7: White

Examples:

ansiconcolor

About

The configuration about windows command line

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published