all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Shell in Cygwin Emacs doesn't source .bashrc
@ 2011-04-04  5:06 David M. Karr
  2011-04-04 12:05 ` Perry Smith
  0 siblings, 1 reply; 3+ messages in thread
From: David M. Karr @ 2011-04-04  5:06 UTC (permalink / raw
  To: help-gnu-emacs

I'm on a new Windows Seven box, with the latest released Cygwin and 
Cygwin Emacs. I copied over my .emacs file from an older Cygwin 
installation on a Windows XP box.

On the old WinXP box, after I start Emacs and execute "shell", it 
appears to properly execute my .bashrc, setting my PS1 and putting me in 
my home directory.

On the new box, when I execute "shell", the prompt isn't set to my PS1 
value, and the current directory is "/usr/bin".

If I execute "bash" at that point, and then "cd", I'm where I should be, 
and with my environment set up.

Something obviously changed between the older installation and the 
latest, which my older .emacs isn't dealing with properly.

I don't currently have a "$HOME/.emacs_bash" file. I don't know if I 
need it.

I start Emacs with the following shortcut command line:

      C:\cygwin\bin\run.exe -p /usr/bin emacs-X11.exe -display 127.0.0.1:0.0

I have a feeling this line might be the problem.  Do I have to make this 
run "bash" instead, and have that run Emacs?

If it matters, here is my current shell-mode-hook function, which I set 
to "shell-mode-hook" in a "custom-set-variables" block:
---------------------------
(defun my-shell-mode-hook ()
   (add-hook 'comint-output-filter-functions
         'comint-watch-for-password-prompt nil t)
   (setq explicit-shell-file-name "bash")
   (setq shell-file-name explicit-shell-file-name)
   (ansi-color-for-comint-mode-on)
   (setq shell-prompt-pattern "^\[[A-z0-9]+:[A-z0-9/]+\] ")
   (local-set-key "\C-xs" 'cycle-go-shell)
   (local-set-key "\C-xS" 'cycle-find-shell-or-shells-buffer-list)
   (local-set-key "\C-j" 'lfd-send-input)
   (local-set-key [f5] 'comint-previous-matching-input-from-input)
   (local-set-key [f12] 'compilation-shell-minor-mode)
   )
---------------------------



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Shell in Cygwin Emacs doesn't source .bashrc
  2011-04-04  5:06 Shell in Cygwin Emacs doesn't source .bashrc David M. Karr
@ 2011-04-04 12:05 ` Perry Smith
  2011-04-04 14:05   ` Peter Dyballa
  0 siblings, 1 reply; 3+ messages in thread
From: Perry Smith @ 2011-04-04 12:05 UTC (permalink / raw
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1659 bytes --]


On Apr 4, 2011, at 12:06 AM, David M. Karr wrote:

> I'm on a new Windows Seven box, with the latest released Cygwin and Cygwin Emacs. I copied over my .emacs file from an older Cygwin installation on a Windows XP box.
> 
> On the old WinXP box, after I start Emacs and execute "shell", it appears to properly execute my .bashrc, setting my PS1 and putting me in my home directory.

Does your old box have a .bash_profile?  Here is from the man page of bash:

>        When  bash is invoked as an interactive login shell, or as a non-inter-
>        active shell with the --login option, it first reads and executes  com-
>        mands  from  the file /etc/profile, if that file exists.  After reading
>        that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile,
>        in  that order, and reads and executes commands from the first one that
>        exists and is readable.  The --noprofile option may be  used  when  the
>        shell is started to inhibit this behavior.
> 
>        When  a  login  shell  exits, bash reads and executes commands from the
>        file ~/.bash_logout, if it exists.
> 
>        When an interactive shell that is not a login shell  is  started,  bash
>        reads  and executes commands from ~/.bashrc, if that file exists.  This
>        may be inhibited by using the --norc option.  The --rcfile file  option
>        will  force  bash  to  read  and  execute commands from file instead of
>        ~/.bashrc.


Note that coming from Emacs, it will be interactive and thus not source .bashrc.  I have my .bash_profile eventually call my .bashrc file.

HTH
Perry


[-- Attachment #2: Type: text/html, Size: 3457 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Shell in Cygwin Emacs doesn't source .bashrc
  2011-04-04 12:05 ` Perry Smith
@ 2011-04-04 14:05   ` Peter Dyballa
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Dyballa @ 2011-04-04 14:05 UTC (permalink / raw
  To: Perry Smith, David Karr; +Cc: help-gnu-emacs


Am 04.04.2011 um 14:05 schrieb Perry Smith:

> Note that coming from Emacs, it will be interactive and thus not  
> source .bashrc.


It's also possible to use a file $HOME/.emacs_bash. It's documented.

--
Greetings

   Pete

Don't force it; get a larger hammer.
				– Anthony's Law of Force




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-04-04 14:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-04  5:06 Shell in Cygwin Emacs doesn't source .bashrc David M. Karr
2011-04-04 12:05 ` Perry Smith
2011-04-04 14:05   ` Peter Dyballa

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.