Notices: This section not yet converted to new layout. Download stats are rolling back out.

ConEmu

17.9.10.0

Package test results are passing.

Private CDN cached downloads available for licensed customers. Never experience 404 breakages again! Learn more...

This package was approved as a trusted package on 9/11/2017.

ConEmu-Maximus5 (short for Console Emulator) is a handy and full featured Windows console window (local terminal) with a lot of enhancements: panes, tabs, tasks, jump lists, quake style, handy text and block selection, handy paste of paths in either Unix or Windows notation, and much more.

ConEmu may work as either standalone window, or embeddable console control. And it may host two types of applications:
* ‘console’: cmd, powershell, Far Manager, bash, and many others;
* ‘graphical’ (GUI): Notepad, PuTTY, GVim, mintty and so on.

Short list of features:
* predefined and user-defined tasks for different shells;
* user friendly text and block selection and paste;
* smooth and friendly window resizing;
* Windows 7 Jump Lists and Progress on Taskbar buttons;
* DosBox integration: run old DOS applications (games) in modern OS;
* quake-style and full screen window modes;
* ANSI sequences and Xterm 256 colors;
* cursor: standard console (horizontal) or GUI (vertical);
* customizable starting tabs;
* Far Manager integration: drag-n-drop, tabs, truecolor, thumbnails;
* unicode and CJK support;
* explore much more features on the project site.

To install ConEmu, run the following command from the command line or from PowerShell:

C:\> choco install conemu

To upgrade ConEmu, run the following command from the command line or from PowerShell:

C:\> choco upgrade conemu

Files

Hide
  • tools\chocolateyInstall.ps1 Show
    $package = 'ConEmu'
    $version = '17.09.10'
    $sha256 = 'B72C7DA03F9DB0FFC5710E83F65BDDBEE5880641C17B0954B08D260AA69CC872'
    
    $isSytem32Bit = (($Env:PROCESSOR_ARCHITECTURE -eq 'x86') -and `
      ($Env:PROCESSOR_ARCHITEW6432 -eq $null))
    
    $os = if ($isSytem32Bit) { "x86" } else { "x64" }
    
    $url = "https://github.com/Maximus5/ConEmu/releases/download/v$version/ConEmuSetup.$($version.replace('.','')).exe"
    
    # MSI installer, but packed inside wrapper to select x86 or x64
    # version. Therefore, treat it as EXE type.
    $params = @{
      PackageName = $package;
      FileType = 'exe';
      SilentArgs = "/p:$os /quiet /norestart";
      Url = $url;
      Url64bit = $url;
      checksum      = $sha256
      checksumType  = 'sha256'
      checksum64    = $sha256
      checksumType64= 'sha256'
    }
    
    $script:CE_PID = 0
    $script:CE_SRV = 0
    $script:CE_WND = 0
    $script:CE_DIR = ""
    
    $script:ConEmuC = ""
    
    $script:CE_FILES = @()
    
    function log($s) {
      # Write-Host $s
    }
    
    function initWinApi() {
        Add-Type @"
          using System;
          using System.Text;
          using System.Runtime.InteropServices;
          public class ConEmuApi
          {
            [DllImport("user32.dll", SetLastError=true, CharSet=CharSet.Auto)]
            public static extern int IsWindow(IntPtr hwnd);
    
            [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
            static extern bool MoveFileEx(string lpExistingFileName, string lpNewFileName, int dwFlags);
    
            public static bool MarkFileDelete(string sourcefile)
            {
              return MoveFileEx(sourcefile, null, 4);
            }
          }
    "@
    }
    
    function isWindowAlive($hwnd) {
      if (("ConEmuApi" -as [type]) -eq $null) {
        initWinApi
      }
    
      $rc = [ConEmuApi]::IsWindow($hwnd)
      # log "HWND=$hwnd, rc=$rc"
      return ($rc -ne 0)
    }
    
    function isProcessAlive($id) {
      if ((Get-Process -Id $id -ErrorAction Ignore) -eq $Null) {
        return $False
      }
      return $True
    }
    
    function isConEmu() {
      if (($env:ConEmuDrawHWND -eq $Null) -Or ($env:ConEmuPID -eq $Null) -Or
          ($env:ConEmuServerPID -eq $Null) -Or ($env:ConEmuBaseDir -eq $Null)) {
        return $False
      }
    
      $id = [convert]::ToInt32($env:ConEmuPID)
      $srv = [convert]::ToInt32($env:ConEmuServerPID)
      $wnd = [convert]::ToInt32($env:ConEmuDrawHWND, 16)
    
      if (-Not (isProcessAlive $id)) {
        return $False
      }
    
      if (-Not (isWindowAlive $wnd)) {
        return $False
      }
    
      if (Test-Path -path (Join-Path $env:ConEmuBaseDir "ConEmuC.exe") -pathtype leaf) {
        $script:ConEmuC = Join-Path $env:ConEmuBaseDir "ConEmuC.exe"
      } elseif (Test-Path -path (Join-Path $env:ConEmuBaseDir "ConEmuC64.exe") -pathtype leaf) {
        $script:ConEmuC = Join-Path $env:ConEmuBaseDir "ConEmuC64.exe"
      } else {
        return $False
      }
    
      $script:CE_PID = $id
      $script:CE_SRV = $srv
      $script:CE_WND = $wnd
      $script:CE_DIR = $env:ConEmuBaseDir
      return $True
    }
    
    function unlockFiles($files) {
      $suffix = Get-Date -format yyMMddHHmmss
      foreach ($fn in $files) {
        $f = @{src_name=$fn; tmp_name=".$fn.$suffix";}
        $f.Add("src", (Join-Path $script:CE_DIR $f.src_name))
        $f.Add("tmp", (Join-Path $script:CE_DIR $f.tmp_name))
        try {
          if (Test-Path -path $f.src -pathtype leaf) {
            Rename-Item -Path $f.src -NewName $f.tmp_name -ErrorAction Stop
            $script:CE_FILES += $f
          }
        } catch {
        }
      }
    }
    
    function removeTempFiles() {
      foreach ($f in $script:CE_FILES) {
        try {
          Remove-Item $f.tmp -ErrorAction Stop
        } catch {
          $deleteResult = [ConEmuApi]::MarkFileDelete($f.tmp)
        }
      }
    }
    
    function restoreFiles() {
      foreach ($f in $script:CE_FILES) {
        try {
          Rename-Item -Path $f.tmp -NewName $f.src_name -ErrorAction Stop
        } catch {
          log "Failed to restore file: $($f.src_name)"
        }
      }
    }
    
    function ConEmuPreUpdate() {
      # Checking
      if (isConEmu) {
        # Note, old ConEmu versions weren't able to detach without confirmation
        log "Detaching from ConEmu"
        $warn_msg = "Please choose <Yes> in the confirmation dialog"
        Write-Host -ForegroundColor Green -NoNewLine $warn_msg
        $macro_rc = & $script:ConEmuC -GuiMacro:$script:CE_PID detach 3
        Write-Host -NoNewLine ("`r".PadRight($warn_msg.length+1)+"`r")
    
        $wait_delay = 10000
        $wait_ms = 250
        $wait_count = $wait_delay/$wait_ms
    
        # log "Code=$LASTEXITCODE" # may be always 0 and "OK"
        # Sleep for 10 sec waiting for detach
        $warn_msg = "Waiting for detach"
        Write-Host -ForegroundColor Green -NoNewLine $warn_msg
        for ($i = 0; $i -lt $wait_count; $i++) {
          if (-Not (isWindowAlive $script:CE_WND)) {
            log "Detached successfully"
            break
          }
          # Write-Host -NoNewLine "."
          Sleep -m $wait_ms
        }
        Write-Host -NoNewLine ("`r".PadRight($warn_msg.length+1)+"`r")
        if ($i -eq $wait_count) {
          throw "Detach failed, please try to run update outside of ConEmu"
        }
        
    
        if (isProcessAlive $script:CE_PID) {
          Sleep -s 1
          if (isProcessAlive $script:CE_PID) {
            $warn_msg = "Requesting ConEmu termination"
            Write-Host -ForegroundColor Green -NoNewLine $warn_msg
            $macro_rc = & $script:ConEmuC -GuiMacro:$script:CE_PID close 2
            for ($i = 0; $i -lt $wait_count; $i++) {
              if (-Not (isProcessAlive $script:CE_PID)) {
                log "Terminated successfully"
                break
              }
              # Write-Host -NoNewLine "."
              Sleep -m $wait_ms
            }
            Write-Host -NoNewLine ("`r".PadRight($warn_msg.length+1)+"`r")
            if ($i -eq $wait_count) {
              throw "ConEmu process still alive, please try to run update outside of ConEmu"
            }
          }
        }
    
        if (isProcessAlive $script:CE_SRV) {
          log "Terminating console server process PID=$($script:CE_SRV)"
          Stop-Process -Force -Id $script:CE_SRV
        }
    
        log "Renaming hooks libraries"
        unlockFiles @("ConEmuHk.dll", "ConEmuHk64.dll")
    
        log "Console is ready to update ConEmu"
    
      } else {
        $is_conemu = $FALSE
        try {
          & ConEmuC.exe -IsConEmu
          $is_conemu = ($LASTEXITCODE -eq 1)
        } catch {
        }
        if ($is_conemu) {
          throw "Can't detect proper ConEmu environment variables! Please restart console!"
        }
    
        log "PowerShell was not stared from ConEmu"
      }
    }
    
    function ConEmuPostUpdate() {
      if ($script:CE_FILES.Count -ne 0) {
        if (Test-Path -path $script:CE_FILES[0] -pathtype leaf) {
          # On Success
          removeTempFiles
        } else {
          # On Failure
          restoreFiles
        }
      }
      if ($script:CE_PID -ne 0) {
        Write-Host -ForegroundColor Green "Console restart is strongly recommended to gain proper ConEmu environment"
        # Reattach
        $rc = Start-Process -FilePath $script:ConEmuC -ArgumentList @("/ATTACH","/NOCMD") -NoNewWindow
        for ($i = 0; $i -lt 100; $i++) {
          $rc = & $script:ConEmuC -IsConEmu
          if ($LASTEXITCODE -eq 1) { break }
          Sleep -m 100
        }
      }
    }
    
    # Unlock ConEmu binaries
    ConEmuPreUpdate
    
    # Do installation/update
    Install-ChocolateyPackage @params
    
    # Try to restore files if update has failed
    ConEmuPostUpdate
    
    # Done
    
  • tools\chocolateyUninstall.ps1 Show
    $package = 'ConEmu'
    $version = '17.09.10'
    
    
    $isSytem32Bit = (($Env:PROCESSOR_ARCHITECTURE -eq 'x86') -and `
      ($Env:PROCESSOR_ARCHITEW6432 -eq $null))
    
    $os = if ($isSytem32Bit) { "x86" } else { "x64" }
    
    $displayName = "ConEmu $($version.replace('.','')).$os"
    
    $installerRoot = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer'
    $productsRoot = "$installerRoot\UserData\S-1-5-18\Products"
    
    
    # To avoid unexpected PC reboot, prohibit ConEmu uninstall from ConEmu
    $is_conemu = $FALSE
    try {
      & ConEmuC.exe -IsConEmu
      $is_conemu = ($LASTEXITCODE -eq 1)
    } catch {
    }
    if ($is_conemu) {
      throw "Can't detect proper ConEmu environment variables! Please restart console!"
    }
    
    
    Write-Host "Searching for installed msi-packet..."
    
    # ConEmu packages do not have fixed GUIDs
    $pkg = ""
    Get-ChildItem $productsRoot |
      % { ($productsRoot + "\" + (Split-Path -Leaf $_.Name) + "\InstallProperties") } |
      ? { ($pkg -eq "") -And (Test-Path $_) } |
      ? { ((Get-ItemProperty $_).DisplayName -eq $displayName) } |
      % {
        $pkg = (Get-ItemProperty $_).LocalPackage
      }
    if ($pkg -ne "") {
      # Write-Host "Found at $pkg"
      Write-Host "Uninstalling '$displayName' via 'msiexec /x $pkg'"
      Start-Process -Wait msiexec -ArgumentList @("/x", $pkg, "/qb-!")
    }
    
    # Done
    

Virus Scan Results

In cases where actual malware is found, the packages are subject to removal. Software sometimes has false positives. Moderators do not necessarily validate the safety of the underlying software, only that a package retrieves software from the official distribution point and/or validate embedded software against official distribution point (where distribution rights allow redistribution).

Chocolatey Pro provides runtime protection from possible malware.

Dependencies

This package has no dependencies.

Maintainer(s)

Software Author(s)

  • Maximus5

Copyright

© 2015, Maximus5

Tags

Release Notes

http://conemu.github.io/en/Whats_New.html

Version History

Version Downloads Last updated Status
ConEmu 17.8.19.0 5482 Saturday, August 19, 2017 approved
ConEmu 17.8.7.0 3412 Tuesday, August 8, 2017 approved
ConEmu 17.8.5.0 1375 Sunday, August 6, 2017 approved
ConEmu 17.7.30.0 2630 Sunday, July 30, 2017 approved
ConEmu 17.7.23.0 2733 Sunday, July 23, 2017 approved
ConEmu 17.7.9.0 3811 Monday, July 10, 2017 approved
ConEmu 17.7.5.0 1678 Thursday, July 6, 2017 approved
ConEmu 17.6.22.0 3436 Friday, June 23, 2017 approved
ConEmu 17.6.5.0 4234 Tuesday, June 6, 2017 approved
Show More

Discussion for the ConEmu Package

Ground rules:

  • This discussion is only about ConEmu and the ConEmu package. If you have feedback for Chocolatey, please contact the google group.
  • This discussion will carry over multiple versions. If you have a comment about a particular version, please note that in your comments.
  • The maintainers of this Chocolatey Package will be notified about new comments that are posted to this Disqus thread, however, it is NOT a guarantee that you will get a response. If you do not hear back from the maintainers after posting a message below, please follow up by using the link on the left side of this page or follow this link to contact maintainers. If you still hear nothing back, please follow the package triage process.
  • Tell us what you love about the package or ConEmu, or tell us what needs improvement.
  • Share your experiences with the package, or extra configuration or gotchas that you've found.
  • If you use a url, the comment will be flagged for moderation until you've been whitelisted. Disqus moderated comments are approved on a weekly schedule if not sooner. It could take between 1-5 days for your comment to show up.

comments powered by Disqus