public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Interactive non-login shell and tilde expansion
@ 2014-01-14  3:54 Steven Penny
  2014-01-14  6:26 ` Steven Penny
  0 siblings, 1 reply; 8+ messages in thread
From: Steven Penny @ 2014-01-14  3:54 UTC (permalink / raw)
  To: cygwin

If you look at the Cygwin.bat file you have this line

    bash --login -i

Starting Cygwin this way yields expected results

    $ cat ~/foo.sh
    cat -v <<< ~

    $ ~/foo.sh
    /home/Steven

However if you change the line in Cygwin.bat to this

    bash -i

it produces unexpected results

    $ ~/foo.sh
    /home/Steve0^G

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: Interactive non-login shell and tilde expansion
  2014-01-14  3:54 Interactive non-login shell and tilde expansion Steven Penny
@ 2014-01-14  6:26 ` Steven Penny
  2014-01-14 16:54   ` Larry Hall (Cygwin)
  0 siblings, 1 reply; 8+ messages in thread
From: Steven Penny @ 2014-01-14  6:26 UTC (permalink / raw)
  To: cygwin

On Mon, Jan 13, 2014 at 9:54 PM, Steven Penny wrote
>     $ ~/foo.sh
>     /home/Steve0^G

Update, it only produces this output if I enter "~/foo.sh" using tab completion.
That is to say, "~/f" + TAB. If I manually enter each character, it works as
expected.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: Interactive non-login shell and tilde expansion
  2014-01-14  6:26 ` Steven Penny
@ 2014-01-14 16:54   ` Larry Hall (Cygwin)
  2014-01-14 23:01     ` Steven Penny
  2014-01-14 23:50     ` Steven Penny
  0 siblings, 2 replies; 8+ messages in thread
From: Larry Hall (Cygwin) @ 2014-01-14 16:54 UTC (permalink / raw)
  To: cygwin

On 1/14/2014 1:26 AM, Steven Penny wrote:
> On Mon, Jan 13, 2014 at 9:54 PM, Steven Penny wrote
>>      $ ~/foo.sh
>>      /home/Steve0^G
>
> Update, it only produces this output if I enter "~/foo.sh" using tab completion.
> That is to say, "~/f" + TAB. If I manually enter each character, it works as
> expected.

Sorry, I cannot reproduce this.  I guess we need more info if you're still
having the problem.  See the problem reporting guidelines at the link below.

> Problem reports:       http://cygwin.com/problems.html


-- 
Larry

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: Interactive non-login shell and tilde expansion
  2014-01-14 16:54   ` Larry Hall (Cygwin)
@ 2014-01-14 23:01     ` Steven Penny
  2014-01-14 23:50     ` Steven Penny
  1 sibling, 0 replies; 8+ messages in thread
From: Steven Penny @ 2014-01-14 23:01 UTC (permalink / raw)
  To: cygwin

On Tue, Jan 14, 2014 at 10:54 AM, Larry Hall (Cygwin) wrote
> Sorry, I cannot reproduce this.  I guess we need more info if you're still
> having the problem.  See the problem reporting guidelines at the link below.

So I tried this again, more in depth

- Delete C:\cygwin folder
- Fresh download of setup-x86 and x86_64

configuration and results

    setup-x86     http://box-soft.com       /home/Steve0^G
    setup-x86_64  http://box-soft.com       /home/SteveM-^P-
    setup-x86     http://cygwin.osuosl.org  /home/Steve0^G
    setup-x86_64  http://cygwin.osuosl.org  /home/SteveM-^P-

Then I downloaded Windows 7 Ultimate x86 English
http://msft.digitalrivercontent.net/win/X17-59463.iso
and loaded it into VirtualBox

configuration and result

    setup-x86  http://box-soft.com  /home/Steve`^F

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: Interactive non-login shell and tilde expansion
  2014-01-14 16:54   ` Larry Hall (Cygwin)
  2014-01-14 23:01     ` Steven Penny
@ 2014-01-14 23:50     ` Steven Penny
  2014-01-15  0:01       ` Steven Penny
  2014-01-15  0:15       ` Larry Hall (Cygwin)
  1 sibling, 2 replies; 8+ messages in thread
From: Steven Penny @ 2014-01-14 23:50 UTC (permalink / raw)
  To: cygwin

On Tue, Jan 14, 2014 at 10:54 AM, Larry Hall (Cygwin) wrote
>> Problem reports:       http://cygwin.com/problems.html

After running

    cygcheck -s -v -r

on both a "good" and "bad" Cygwin.bat I ran a "git diff" and noticed this

    +PS1 = '\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ '

So I tried it and that looks to be the issue. However it doesnt make much sense
because even with "bad" Cygwin.bat PS1 seems to be already defined

    $ echo "$PS1"
    \[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$

    $ ~/foo.sh
    /home/Steve0^G

    $ export PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ '

    $ ~/foo.sh
    /home/Steven

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: Interactive non-login shell and tilde expansion
  2014-01-14 23:50     ` Steven Penny
@ 2014-01-15  0:01       ` Steven Penny
  2014-01-15  0:15       ` Larry Hall (Cygwin)
  1 sibling, 0 replies; 8+ messages in thread
From: Steven Penny @ 2014-01-15  0:01 UTC (permalink / raw)
  To: cygwin

On Tue, Jan 14, 2014 at 5:50 PM, Steven Penny wrote
> However it doesnt make much sense because even with "bad" Cygwin.bat PS1 seems
> to be already defined

To answer my own question, PS1 is already defined, but not exported. This is
because the export happens in /etc/profile, which is called with the "--login"
option. Example

    $ ~/foo.sh
    /home/Steve0^G

    $ export PS1

    $ ~/foo.sh
    /home/Steven

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: Interactive non-login shell and tilde expansion
  2014-01-14 23:50     ` Steven Penny
  2014-01-15  0:01       ` Steven Penny
@ 2014-01-15  0:15       ` Larry Hall (Cygwin)
  2014-01-15  0:22         ` Steven Penny
  1 sibling, 1 reply; 8+ messages in thread
From: Larry Hall (Cygwin) @ 2014-01-15  0:15 UTC (permalink / raw)
  To: cygwin

On 1/14/2014 6:50 PM, Steven Penny wrote:
> On Tue, Jan 14, 2014 at 10:54 AM, Larry Hall (Cygwin) wrote
>>> Problem reports:       http://cygwin.com/problems.html
>
> After running
>
>      cygcheck -s -v -r
>
> on both a "good" and "bad" Cygwin.bat I ran a "git diff" and noticed this
>
>      +PS1 = '\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ '
>
> So I tried it and that looks to be the issue. However it doesnt make much sense
> because even with "bad" Cygwin.bat PS1 seems to be already defined
>
>      $ echo "$PS1"
>      \[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$
>
>      $ ~/foo.sh
>      /home/Steve0^G
>
>      $ export PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ '
>
>      $ ~/foo.sh
>      /home/Steven

My PS1 is also set.  I'm wondering why it doesn't show up in your output
above though.  Perhaps it's time to add 'set -x' to your ~/.bash_profile
and ~/.bashrc to see what gets invoked on your end.

-- 
Larry

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: Interactive non-login shell and tilde expansion
  2014-01-15  0:15       ` Larry Hall (Cygwin)
@ 2014-01-15  0:22         ` Steven Penny
  0 siblings, 0 replies; 8+ messages in thread
From: Steven Penny @ 2014-01-15  0:22 UTC (permalink / raw)
  To: cygwin

On Tue, Jan 14, 2014 at 6:15 PM, Larry Hall (Cygwin) wrote
> Perhaps it's time to add 'set -x' to your ~/.bash_profile and ~/.bashrc to see
> what gets invoked on your end.

Problem has been solved, I think you missed this link

http://cygwin.com/ml/cygwin/2014-01/msg00152.html

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

end of thread, other threads:[~2014-01-15  0:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-14  3:54 Interactive non-login shell and tilde expansion Steven Penny
2014-01-14  6:26 ` Steven Penny
2014-01-14 16:54   ` Larry Hall (Cygwin)
2014-01-14 23:01     ` Steven Penny
2014-01-14 23:50     ` Steven Penny
2014-01-15  0:01       ` Steven Penny
2014-01-15  0:15       ` Larry Hall (Cygwin)
2014-01-15  0:22         ` Steven Penny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).