Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mini launch bash #2852

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,10 @@ launcher/src/version.rc2
.vs/*
.vscode
.idea
.vagrant/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you like to move some of the gitignores here to the Vagrant + Packer branch?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is my opinion this vranch should be merged with master. I see no reason to maintain a second branch.

scripts/packer/iso/*.iso
!scripts/packer/floppy/*.exe
scripts/packer/packer_cache
scripts/packer/output-*
*.box

11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Change Log

## [UNRELEASED](https://github.com/cmderdev/cmder/tree/master) (2022-06-05)

### Adds

- Cmder Mini
- Launching Git Bash from external Git for Windows install.

### Changes

- Update Git Prompt with changes from Git for Windows

## [1.3.20](https://github.com/cmderdev/cmder/tree/v1.3.20) (2022-03-18)

### Changes
Expand Down
133 changes: 82 additions & 51 deletions vendor/ConEmu.xml.default

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions vendor/cmder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ CMDER_ROOT=$(echo $CMDER_ROOT | sed 's:/*$::')

export CMDER_ROOT

if [ -f "/c/Program Files/Git/cmd/git.exe" ] ; then
if [ -f "${CMDER_ROOT}/vendor/git-for-windows/cmd/git.exe" ] ; then
GIT_INSTALL_ROOT=${CMDER_ROOT}/vendor/git-for-windows
elif [ -f "/c/Program Files/Git/cmd/git.exe" ] ; then
GIT_INSTALL_ROOT="/c/Program Files/Git"
elif [ -f "/c/Program Files(x86)/Git/cmd/git.exe" ] ; then
GIT_INSTALL_ROOT="/c/Program Files(x86)/Git"
elif [ -f "${CMDER_ROOT}/vendor/git-for-windows/cmd/git.exe" ] ; then
GIT_INSTALL_ROOT=${CMDER_ROOT}/vendor/git-for-windows
fi

if [[ ! "$PATH" =~ "${GIT_INSTALL_ROOT}/bin:" ]] ; then
Expand Down
11 changes: 4 additions & 7 deletions vendor/cmder_exinit
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Copy this file to your non integrated *nix-like environment,
#!/usr/bin/env bash

## Copy this file to your non integrated *nix-like environment,
# Cygwin/MSys2/Git for Windows SDK, installs '/etc/profile.d/'
# folder to integrate the externally installed Unix like environment
# into Cmder so it has access to settings stored in Cmder/config
Expand Down Expand Up @@ -34,7 +36,6 @@ function runProfiled {

if [ ! "x${profile_d_scripts}" = "x" ] ; then
for x in ${profile_d_scripts} ; do
echo Sourcing "${1}/${x}"...
. "${1}/${x}"
done
fi
Expand All @@ -46,10 +47,8 @@ function runProfiled {

# We do this for bash as admin sessions since $CMDER_ROOT is not being set
if [ "$CMDER_ROOT" = "" -a "$ConEmuDir" != "" ] ; then
if [ -d "${ConEmuDir}../../vendor" ] ; then
if [ -d "${ConEmuDir}/../../vendor" ] ; then
case "$ConEmuDir" in *\\*) CMDER_ROOT=$( cd "$(cygpath -u "$ConEmuDir")/../.." ; pwd );; esac
else
echo "Running in ConEmu without Cmder, skipping Cmder integration."
fi
elif [ "$CMDER_ROOT" != "" ] ; then
case "$CMDER_ROOT" in *\\*) CMDER_ROOT="$(cygpath -u "$CMDER_ROOT")";; esac
Expand All @@ -59,8 +58,6 @@ if [ ! "$CMDER_ROOT" = "" ] ; then
# Remove any trailing '/'
CMDER_ROOT=$(echo $CMDER_ROOT | sed 's:/*$::')

echo "Using \"CMDER_ROOT\" at \"${CMDER_ROOT}\"."

export CMDER_ROOT

PATH=${CMDER_ROOT}/bin:${CMDER_ROOT}/vendor/bin:$PATH:${CMDER_ROOT}
Expand Down
15 changes: 13 additions & 2 deletions vendor/git-prompt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ then
. ~/.config/git/git-prompt.sh
fi
else
PS1='\[\033]0;$MSYSTEM:${PWD//[^[:ascii:]]/?}\007\]' # set window title
PS1='\[\033]0;$TITLEPREFIX:$PWD\007\]' # set window title
# PS1="$PS1"'\n' # new line
PS1="$PS1"'\[\033[32m\]' # change to green
PS1="$PS1"'\u@\h ' # user@host<space>
Expand Down Expand Up @@ -71,4 +71,15 @@ else
PS1="$PS1"'λ ' # prompt: always λ
fi

MSYS2_PS1="$PS1" # for detection by MSYS2 SDK's bash.basrc
MSYS2_PS1="$PS1" # for detection by MSYS2 SDK's bash.basrc

# Evaluate all user-specific Bash completion scripts (if any)
if test -z "$WINELOADERNOEXEC"
then
for c in "$HOME"/bash_completion.d/*.bash
do
# Handle absence of any scripts (or the folder) gracefully
test ! -f "$c" ||
. "$c"
done
fi
47 changes: 47 additions & 0 deletions vendor/start_git_bash.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
@echo off

if not defined CMDER_ROOT (
if defined ConEmuDir (
for /f "delims=" %%i in ("%ConEmuDir%\..\..") do (
set "CMDER_ROOT=%%~fi"
)
) else (
for /f "delims=" %%i in ("%~dp0\..") do (
set "CMDER_ROOT=%%~fi"
)
)
)

if defined ConEmuDir (
set "gitCommand=--command=%ConEmuBaseDirShort%\conemu-msys2-64.exe"
)

if exist "%CMDER_ROOT%\vendor\git-for-windows" (
set "PATH=%CMDER_ROOT%\vendor\git-for-windows\usr\bin;%PATH%"
set "gitCmd=%CMDER_ROOT%\vendor\git-for-windows\git-cmd.exe"
set "bashCmd=%CMDER_ROOT%\vendor\git-for-windows\usr\bin\bash.exe"
) else if exist "%ProgramFiles%\git" (
set "PATH=%ProgramFiles%\git\usr\bin;%PATH%"
set "gitCmd=%ProgramFiles%\git\git-cmd.exe"
set "bashCmd=%ProgramFiles%\git\usr\bin\bash.exe"
if not exist "%ProgramFiles%\git\etc\profile.d\cmder_exinit.sh" (
echo Run 'mklink "%ProgramFiles%\git\etc\profile.d\cmder_exinit.sh" "%CMDER_ROOT%\vendor\cmder_exinit"' in 'cmd::Cmder as Admin' to use Cmder with external Git Bash
echo.
echo or
echo.
echo Run 'echo "" ^> "%ProgramFiles%\git\etc\profile.d\cmder_exinit.sh"' in 'cmd::Cmder as Admin' to disable this message.
)
) else if exist "%ProgramFiles(x86)%\git" (
set "PATH=%ProgramFiles(x86)%\git\usr\bin;%PATH%"
set "gitCmd=%ProgramFiles(x86)%\git\git-cmd.exe"
set "bashCmd=%ProgramFiles(x86)%\git\usr\bin\bash.exe"
if not exist "%ProgramFiles(x86)%\git\etc\profile.d\cmder_exinit.sh" (
echo Run 'mklink "%ProgramFiles^(x86^)%\git\etc\profile.d\cmder_exinit.sh" "%CMDER_ROOT%\vendor\cmder_exinit"' in 'cmd::Cmder as Admin' to use Cmder with external Git Bash
echo.
echo or
echo.
echo Run 'echo "" ^> "%ProgramFiles^(x86^)%\git\etc\profile.d\cmder_exinit.sh"' in 'cmd::Cmder as Admin' to disable this message.
)
)

"%gitCmd%" --no-cd %gitCommand% "%bashCmd%" --login -i