Skip to content

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

Closed

Description

@exhuma

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

Activity

  1. fmoo commented on Jul 16, 2015

    @fmoo
    Owner

    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

  2. exhuma commented on Jul 16, 2015

    @exhuma
    Author
    $ 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
    
  3. fmoo commented on Jul 16, 2015

    @fmoo
    Owner

    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?

  4. exhuma commented on Jul 16, 2015

    @exhuma
    Author

    Tested and it works :)

    Thanks for the quick reply 👍

  5. leggewie commented on Aug 8, 2019

    @leggewie

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions