help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Shell not executing loading aliases


From: David M. Karr
Subject: Shell not executing loading aliases
Date: Thu, 07 Apr 2011 16:21:52 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9

I'm using GNU Emacs 23.3.1 with Cygwin 1.7.8 on Win7SP1.

I start Emacs from a desktop shortcut with the following command line:

C:\cygwin\bin\run.exe -p /usr/bin bash -l -i -c "emacs -display 127.0.0.1:0.0"

After Emacs starts up, I execute "shell" which display a shell window showing my desired PS1 prompt. I also echo $PATH, and it appears to be the value I set in my $HOME/.bashrc.

However, at the end of my .bashrc I set a couple of shell aliases, but when I type "alias" at this point, it shows nothing. One of the aliases was for "ls" to give it the "-aF" options, and when I execute "ls", it shows it doesn't have those options set.

I can then execute "bash" and then "ls", and I see it has now set my aliases.

Why doesn't the initial Bash shell have my aliases?

I tried creating a $HOME/.emacs_bash script, doing either ". $HOME/.bashrc" or "source $HOME/.bashrc", but it never tried to execute the script. I even used SysInternals ProcMon to verify it never tried to execute it.

The relevant portion of my shell-mode-hook is as follows:

(defun my-shell-mode-hook ()
  (add-hook 'comint-output-filter-functions
        'comint-watch-for-password-prompt nil t)
  (setq explicit-shell-file-name "bash.exe")
  (setq shell-file-name explicit-shell-file-name)
  (ansi-color-for-comint-mode-on)
  (setq shell-prompt-pattern "^\[[A-z0-9]+:[A-z0-9/]+\] ")
  )




reply via email to

[Prev in Thread] Current Thread [Next in Thread]