Skip to content

[Bug] Cmder not expanding variable in environment variable #2845

@t-ricci-digit

Description

@t-ricci-digit

Version Information

Cmder version: v1.3.21
Operating system: Windows 11

Cmder Edition

Cmder Full (with Git)

Description of the issue

If a Windows Environment Variable from system settings is defined using another environment variables it is not expanded when using CMD.exe inside Cmder.

Example:

ANDROID_HOME=%LOCALAPPDATA%\Android\Sdk

(not just ANDROID_HOME other similar variables do not get expanded as well)

When opening CMD.exe directly (without Cmder) the path is expanded correctly as follows:

> echo %ANDROID_HOME%
C:\Users\user.name\AppData\Local\Android\Sdk

If I print the same variable in CMD.exe from within Cmder then the path is not correct:

> echo %ANDROID_HOME%
%LOCALAPPDATA%\Android\Sdk

This means that when building an android application from the command line it only works in CMD.exe directly but fails from within Cmder

How to reproduce

  1. Set the environment variable ANDROID_HOME=%LOCALAPPDATA%\Android\Sdk from windows settings
  2. open Cmder with a cmd.exe console
  3. type echo %ANDROID_HOME% and press ENTER
  4. Observe the command output in the console, the path is not expanded properly

Additional context

Setting the environment variables from the Cmder settings: startup/environement the variables are expanded correctly.

A workaround for me is currently to define the variables twice: in the windows system settings and in Cmder settings.

It would be best if the variable expansion is working without the need to also duplicate it in Cmder

image

Checklist

  • I have read the documentation.
  • I have searched for similar issues and found none that describe my issue.
  • I have reproduced the issue on the latest version of Cmder.
  • I am certain my issues are not related to ConEmu, Clink, or other third-party tools that Cmder uses.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions