Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using "nano" opens an empty file before loading the selected file. #1

Closed
exhuma opened this issue Jul 16, 2015 · 5 comments
Closed

Comments

@exhuma
Copy link

exhuma commented Jul 16, 2015

When using nano as editor, python-editor first opens an empty file. After closing that file, the given file is opened.

Test script:

from editor import edit
from os import unlink
from tempfile import NamedTemporaryFile


testfile = NamedTemporaryFile(prefix='editest', delete=False)
testfile.write('Hello World!')
testfile.close()


edit(testfile.name)


unlink(testfile.name)

Executing this as follows, works as expected:

EDITOR=vim python testscript.py

However, the following does not open the test file immediately:

EDITOR=nano python testscript.py
@fmoo
Copy link
Owner

fmoo commented Jul 16, 2015

what version of nano and python are you using? I'm having a hard time reproducing with:

$ nano --version
 GNU nano version 2.2.6 (compiled 23:12:47, Jul 16 2014)
 (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
 2008, 2009 Free Software Foundation, Inc.
 Email: nano@nano-editor.org    Web: http://www.nano-editor.org/
 Compiled options: --disable-wrapping-as-root --enable-color --enable-extra --enable-multibuffer --enable-nanorc --enable-utf8

and python2.7

@exhuma
Copy link
Author

exhuma commented Jul 16, 2015

$ nano --version
 GNU nano version 2.2.6 (compiled 19:40:04, Dec  3 2010)
 (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
 2008, 2009 Free Software Foundation, Inc.
 Email: nano@nano-editor.org    Web: http://www.nano-editor.org/
 Compiled options: --disable-wrapping-as-root --enable-color --enable-extra --enable-multibuffer --enable-nanorc --enable-utf8

@fmoo
Copy link
Owner

fmoo commented Jul 16, 2015

Ok, I was able to repro when using the pypi build, but not with my development build. I guess I had a fix for this in master, but forgot to publish.

Can you update to 0.3 and re-test?

@exhuma
Copy link
Author

exhuma commented Jul 16, 2015

Tested and it works :)

Thanks for the quick reply 👍

@exhuma exhuma closed this as completed Jul 16, 2015
@leggewie
Copy link

leggewie commented Aug 8, 2019

I am experiencing this problem again with python-editor 0.4 on Ubuntu bionic with python3 and nano version 2.9.3. Can you reopen?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants