Sublime text 3 Terminus using Cygwin terminal wont accept commands (e.g ls or gcc) (Windows)

0

I have installed Terminus in sublime text 3 and changed the "shell_configs" to use cygwin as the terminal. To do this I edited the code to include the following.

{
        "name": "Cygwin",
        "cmd": ["C:\\cab202_software\\cab202_software\\cygwin\\bin\\bash.exe"],
        "env": {},
        "enable": true,
        "default": true,
        "platforms": ["windows"],

    },

When I try to view the current files in my directory or compile them using ls and gcc respectively it returns the following.

bash: ls: command not found

To check if it was just cygwin, I changed the default back to CMD and the gcc command returned the same error. Both of these commands work in my standard cygwin terminal and CMD.

If anyone could help that would be great.

WhoDunnett

Posted 2019-07-31T05:36:18.837

Reputation: 1

Answers

0

The bash shell is not in login mode. To add the path, install the Terminus package. Go to Preferences > Package Settings > Terminus > Settings. It will open Terminus settings.

terminus-settings-option

Add this following settings (JSON object) in the right side.

{
        "shell_configs": [
        {
            "name": "Cygwin",
            "cmd": ["D:\\Cygwin64\\bin\\bash.exe", "-i", "-l"],
            "env": {},
            "enable": true,
            "default": true,
            "platforms": ["windows"]
        }
    ]
}

The cmd field adds the two required options, -i for interactive mode, -l for login mode. Now open Tools > Command Pallet > Terminus: Open Default Shell In View. It will open cygwin/bash with all the path variables.

terminus-command-pallet

For further readings, go to Terminus repository.

Biswapriyo

Posted 2019-07-31T05:36:18.837

Reputation: 6 640