public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Eliot Moss <moss@cs.umass.edu>
To: Kirill Frolov <frolovkirill7@gmail.com>, cygwin@cygwin.com
Subject: Re: Nano fails to open file "~/.bashrc".
Date: Fri, 3 Mar 2023 10:53:42 -0500	[thread overview]
Message-ID: <6a80105e-c0c2-1bad-16a3-b4f1dd38f3b3@cs.umass.edu> (raw)
In-Reply-To: <caa7e9ab-bc9f-9336-2e88-ef06e1df9384@gmail.com>

On 3/3/2023 10:37 AM, Kirill Frolov via Cygwin wrote:
> 
> On 03.03.2023 18:31, Andrey Repin wrote:
>> Greetings, Kirill Frolov!
>>
>> Please avoid top-posting in this list.
>>
>>> On 03.03.2023 15:47, Andrey Repin wrote:
>>>> Greetings, Kirill Frolov!
>>>>
>>>>> When i run nano ~/.bashrc nano opens with   [ Directory '/home/frolo' does not exist ] error.
>>>> Do you run it from bash prompt or from CMD prompt?
>>>>
>>>>> The file opens with cat ~/.bashrc
>>>> Can you please show us the output of
>>>>
>>>> getent passwd "$USER"; mount; cat /etc/nsswitch.conf
>>>>
>>> I run it with F:\cygwin64\bin\mintty.exe -i /Cygwin-Terminal.ico -
>> Thanks. TBH, I'm baffled. Your setup looks like standard unaltered one.
>> Diagnostics seems clear, but the last bit remains.
>> What the `which nano` says?
>>
>>> $ getent passwd "$USER"; mount; cat /etc/nsswitch.conf
>>> frolo:*:197609:197121:U-DESKTOP-P57624Q\frolo,S-1-5-21-3636099827-1216969241-2011884586-1001:/home/frolo:/bin/bash
>>> F:/cygwin64/bin on /usr/bin type ntfs (binary,auto)
>>> F:/cygwin64/lib on /usr/lib type ntfs (binary,auto)
>>> F:/cygwin64 on / type ntfs (binary,auto)
>>> C: on /cygdrive/c type ntfs (binary,posix=0,user,noumount,auto)
>>> D: on /cygdrive/d type ntfs (binary,posix=0,user,noumount,auto)
>>> E: on /cygdrive/e type ntfs (binary,posix=0,user,noumount,auto)
>>> F: on /cygdrive/f type ntfs (binary,posix=0,user,noumount,auto)
>>> # /etc/nsswitch.conf
>>> #
>>> #    This file is read once by the first process in a Cygwin process tree.
>>> #    To pick up changes, restart all Cygwin processes.  For a description
>>> #    see https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-mapping-nsswitch
>>> #
>>> # Defaults:
>>> # passwd:   files db
>>> # group:    files db
>>> # db_enum:  cache builtin
>>> # db_home:  /home/%U
>>> # db_shell: /bin/bash
>>> # db_gecos: <empty>
>> $ which nano
>> /cygdrive/c/Program Files/Git/usr/bin/nano

I'll jump in: That does not appear to be Cygwin nano, but some other, Windows-based
nano, which would expect Windows type paths, not Cygwin type paths.  You have (at
least) two options:

- Drop that nano and install the Cygwin one;
- Invoke that nano with a Windows path, perhaps like this:

nano $(cygpath -wa ~/.bashrc)

Personally, I'd go with the first option, since CYgwin nano is more likely to
play nicely with Cygwin files ...

Best wishes - Eliot Moss

  reply	other threads:[~2023-03-03 15:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-03 12:43 Kirill Frolov
2023-03-03 12:47 ` Andrey Repin
2023-03-03 12:52   ` Kirill Frolov
2023-03-03 15:31     ` Andrey Repin
2023-03-03 15:37       ` Kirill Frolov
2023-03-03 15:53         ` Eliot Moss [this message]
2023-03-04  9:55           ` Oliver Schoede
2023-03-04 13:21         ` Andrey Repin
2023-03-05 21:19           ` Oliver Schoede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6a80105e-c0c2-1bad-16a3-b4f1dd38f3b3@cs.umass.edu \
    --to=moss@cs.umass.edu \
    --cc=cygwin@cygwin.com \
    --cc=frolovkirill7@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).