Conemu: Not able to start new bash tab with cd into a directory and run a simple npm command

Created on 14 Jan 2018  路  8Comments  路  Source: Maximus5/ConEmu

Versions

ConEmu build: 161206 x64
OS version: Windows 10 latest Developer Mode Enabled
Used shell version : git-bash, cmd, powershell

Problem description

Trie to build a automated task step base on the existing Bash Script task was not successful
I did

%ConEmuDrive%\Git\git-cmd.exe --no-cd --command=usr/bin/bash.exe -l -i
cmd.exe -new_console:d:"cd C:\www && npm start"

Steps to reproduce

  1. create task copy from Bash task
  2. run it
  3. see it open two new tabs instead of running inside the Bash tab

Actual results

two tabs, with one bash and another really just regular windows command line

Expected results

open one bash tab and running the command cd C:\www && npm start in it!

Additional files

image

*Also curious, what exactly are the tasks been written in ConEmu? Are they actually multiple different languages?

Most helpful comment

@adamchenwei do something like this:

> -cur_console:d:C:\code\terminus "%ConEmuDir%\..\Git\git-cmd.exe" --no-cd --command=usr/bin/bash.exe -l -i -c "ls && $SHELL"

-cur_console:s50H:d:C:\code\terminus "%ConEmuDir%\..\Git\git-cmd.exe" --no-cd --command=usr/bin/bash.exe -l -i -c "git status && $SHELL"

Screenshot:
image

All 8 comments

The -new_console:d: doesn't support cd or any other commands.

I don't understand the question about languages.

@Maximus5 the script, or the command that wrote in task, clearly they are not shell script no? I mean that, I dont really type all that in the command line to get into a directory, like in console I only need to do cd C:\www and in this "task" script I have to write all that command, what language is it?

Did you really read the links I posted?

@Maximus5 I did and in additional, I read https://superuser.com/questions/1104567/how-can-i-find-out-the-command-line-options-for-git-bash-exe and https://stackoverflow.com/questions/19916670/how-to-launch-a-git-bash-window-with-particular-working-directory-using-a-script and they are different than what in the ConEmu instruction. Super confused, I am still not too familiar with different kind of command line languages.

Would you able to instruct me on at minmum, how to define a task that opens a default bash command and execute one more command after it? like cd c:\www && npm start?
Just tried -c, but still not working
%ConEmuDrive%\Git\git-cmd.exe --command=usr/bin/bash.exe -l -i -c " cd C:\www"

  • Be precise. Read the messages tools display to you. Words "it doesn't work" means nothing.
  • Don't mix switches from different tools in one place. There is absolutely no sence to pass cd c:\www && npm start into -new_console:d:"...". ConEmu is not a bash.
  • Learn about paths in POSIX, c:\www is illegal there! You must use /c/www instead.
  • At last, your question was answered many times, and there is CygwinStartCmd and CygwinStartDir. And actually, it is related to git-for-windows in much, but not to ConEmu.
%ProgramFiles%\Git\git-cmd.exe --command=usr/bin/bash.exe -c "cd /c/www; pwd; npm start"

@adamchenwei do something like this:

> -cur_console:d:C:\code\terminus "%ConEmuDir%\..\Git\git-cmd.exe" --no-cd --command=usr/bin/bash.exe -l -i -c "ls && $SHELL"

-cur_console:s50H:d:C:\code\terminus "%ConEmuDir%\..\Git\git-cmd.exe" --no-cd --command=usr/bin/bash.exe -l -i -c "git status && $SHELL"

Screenshot:
image

@kdelmonte this final "...&& $SHELL " , was what I was missing.
because git pull would complete , bash.exe would exit and I always got a notification from ConEmu that the command finished in less than 10 seconds and I would never get a command prompt.
Makes sense to add this specific task invokation in GitForWindows as a new subsection "start git for windows, run a command in bash and provide a prompt afterwards"

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dandv picture dandv  路  3Comments

altbdoor picture altbdoor  路  4Comments

pyhedgehog picture pyhedgehog  路  3Comments

Chirishman picture Chirishman  路  3Comments

phazei picture phazei  路  6Comments