From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alexander Shukaev Newsgroups: gmane.emacs.help Subject: Re: Autogen in Emacs Shell Date: Fri, 1 May 2015 16:46:27 +0200 Message-ID: References: <83twvzszjv.fsf@gnu.org> <20150501092657.GA19316@tuxteam.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1430491609 26519 80.91.229.3 (1 May 2015 14:46:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 1 May 2015 14:46:49 +0000 (UTC) Cc: help-gnu-emacs To: tomas@tuxteam.de Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 01 16:46:45 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YoCDD-0006MY-MU for geh-help-gnu-emacs@m.gmane.org; Fri, 01 May 2015 16:46:43 +0200 Original-Received: from localhost ([::1]:54350 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoCDD-0004KI-51 for geh-help-gnu-emacs@m.gmane.org; Fri, 01 May 2015 10:46:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55016) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoCD2-0004IO-9H for help-gnu-emacs@gnu.org; Fri, 01 May 2015 10:46:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YoCD1-0002YB-1K for help-gnu-emacs@gnu.org; Fri, 01 May 2015 10:46:32 -0400 Original-Received: from mail-la0-x231.google.com ([2a00:1450:4010:c03::231]:33124) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoCCy-0002XC-MF; Fri, 01 May 2015 10:46:29 -0400 Original-Received: by layy10 with SMTP id y10so65558480lay.0; Fri, 01 May 2015 07:46:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=7O7Ons2qfXF+3+GIS3Esn6Hb2uqkKJtT+dfd3XOLT+c=; b=lKjtx1KXRQqL2flkViKDnwnjT7KsYUYFS0FiV6rtmqeXuiu+kCY1PqEDeT+OIzIofK LEMDbhUFM0MhswFwnRuDXLtA2tEpFX7ZEUjO0VoJfYN+YdE2dklHlnjoGTFZ7xxxcWhM tGeiuwePrZ3Dxv/WArGJ1U8jd0wW8MDlxjyoJL87vOUCy3j8nu9brZ0mhYqvc6eyWy5j 7FgBmuLvc+MUNRQGNZuOrVDwZ1JJNGgRuNNsuTehNAvhyWNym22391m5Qp/AWZQpbF0y siFD5VN/Ugt/DtCb0y1ezc49aMMSJXLyDN3cekMw2ngq4Frdf0Tehgg81OOQACaOs3Tb tWGg== X-Received: by 10.152.29.67 with SMTP id i3mr8522966lah.64.1430491587673; Fri, 01 May 2015 07:46:27 -0700 (PDT) Original-Received: by 10.112.36.103 with HTTP; Fri, 1 May 2015 07:46:27 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::231 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:104132 Archived-At: I think I found it in one of "post-install" scripts. Let's see what I can do about it. On Fri, May 1, 2015 at 4:33 PM, Alexander Shukaev wrote: > =E2=80=8BMy goodness, this is so weird. I start to hate that, sigh... T= _T > > So to check that it's indeed "/etc/profile" involved in changing to "~". > I do the following: > > 1. Start 'bash' with "M-x bash RET": > > (defun bash > (&optional buffer) > (interactive) > (let ((explicit-shell-file-name "bash") > (explicit-bash-args '("--noediting" "-i"))) > (setq buffer (my-call shell buffer))) > (with-current-buffer buffer > (when (equal (buffer-name) "*shell*") > (rename-buffer "*bash*" t)))) > > =E2=80=8BNOTE: `my-call' macro just properly handles whether to > `call-interactively' or not.=E2=80=8B > > 2. I have "~/emacs.d/init_bash.sh" with > > . /etc/profile > > As a result, here is what I see when I start `bash' from some buffer whic= h > contains file with path let's say "~/dir/file": > > 2015.05.01 Friday 16:07:21 > Haroogan@G75VW:~/dir > $ ]0;~ > Haroogan@G75VW ~ > $ > > A few points here. > > 1. The first prompt is of course mine (coming from ".bashrc"). > 2. Then there goes garbage, it's a separate story by the way. I think I > discovered a bug: this garbage appears when there is some content > in "~/emacs.d/init_bash.sh". Does not matter what kind of content that i= s, > e.g. it could be even be comments. The main point is that the number of > those garbage lines that will appear on the start of `bash' is equal to t= he > number of lines written in "~/emacs.d/init_bash.sh". Like in this case, = we > just have one line in "~/emacs.d/init_bash.sh", so the garbage appears on= e > time. I mean it's like it really types those newlines into shell. > 3. Finally there is another prompt which is obviously coming from the > sourced "/etc/profile". > > I've scanned "/etc/profile" and other files that it sources. There is no > evidence of `cd' to "~". I'm attaching it here, can you find anything th= at > would change to "~"? Thank you. > > =E2=80=8BRegards, > Alexander=E2=80=8B > > > On Fri, May 1, 2015 at 11:26 AM, wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> On Thu, Apr 30, 2015 at 08:14:08PM +0200, Alexander Shukaev wrote: >> [...] >> > > [login shell, check env variables] >> >> > Yes, I'm going to try that. One thing I don't like about "--login" >> though >> > is that it forces `bash' to `cd' to '~'. >> >> Just tried it: bash --login doesn't cd to my $HOME, it just stays "where >> it is". >> Perhaps one of your *profiles (/etc/profile, ~/.profile, ~/.bash_profile >> or >> however those are called in Cygwin-land) is cd-ing to $HOME? >> >> regards >> - -- tom=C3=A1s >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.12 (GNU/Linux) >> >> iEYEARECAAYFAlVDRuEACgkQBcgs9XrR2kZB0wCcCBCmzwjRSBZ0vgw+DTDqSk+5 >> pWEAn1e5EknL1CaN7gymA51pbbFSljy5 >> =3DMzOv >> -----END PGP SIGNATURE----- >> > >