Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.4: Recover from a 'disappearing' pico/nano UNIX
Tiger only hintThere's a bug in nano (and pico, as pico is just symlinked to nano) in 10.4 (including 10.4.4), which can seemingly cause you to lose the document you are working on.

If you have an open document in pico, and then resize the Terminal window to get more space, pico should resize to fill the terminal. Instead, all of the text you're editing, along with pico's interface simply disappears!

For me, this meant a lost shell script first time round, and a search on Google found no way of recovering. ^L to refresh does not work, nor can you run any other commands such as save (^O) or even exit (^X).

The only way to recover pico is to resize the Terminal window to exactly what it was set to before the resize -- hopefully this was your default Terminal window size. pico then magically reappears, with all its functionality restored, and your text in place!

[robg adds: When I tested this, I found that as long as you made the window no larger than your previous window, then all the text would reappear. So you can just resize down to a notably smaller size, and you'll get everything back. But if the new size is even one row or column larger than the original, you'll still have a blank screen. Quite odd.]
    •    
  • Currently 2.50 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[9,923 views]  

10.4: Recover from a 'disappearing' pico/nano | 14 comments | Create New Account
Click here to return to the '10.4: Recover from a 'disappearing' pico/nano' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Recover from a 'disappearing' pico/nano
Authored by: kainewynd2 on Jan 12, '06 06:59:42AM
I found if you shrink it way too small then nano throws a buffer error and saves your document as blah.save

[ Reply to This | # ]
10.4: Recover from a 'disappearing' pico/nano
Authored by: rhartlein on Jan 12, '06 07:25:46AM

pico / nano sometimes has very odd behaviour where cursor position and text in the terminal window do not correspond.

When navigating with the arrow keys, the cursor sometimes prints the contents of another line behind itself while moving, so you never know which line you are *really* editing.

This behaviour is particularly annoying when editing critical scripts or configuration files.

The only help I found is to run nano / pico in an xterm with Apples X11.



[ Reply to This | # ]
10.4: Recover from a 'disappearing' pico/nano
Authored by: drewk on Jan 12, '06 07:36:09AM
I have seen another pico/nano bug to be aware of. At seemingly random times, this will happen:

  • Edit a document
  • Save / exit
  • Notice that hey -- the computer seems slow ?!?!
  • Call up top
  • See that nano is using 100% of CPU time. It didn't realy exit
  • Kill nano...

    [ Reply to This | # ]
  • 10.4: Recover from a 'disappearing' pico/nano
    Authored by: TWanderer on Jan 12, '06 07:46:23AM

    To be on the safe side I replaced my nano 1.2.4 with version 1.2.3. This solved the problem.



    [ Reply to This | # ]
    10.4: Recover from a 'disappearing' pico/nano
    Authored by: GlowingApple on Jan 12, '06 09:52:01AM

    I did the same thing (but with the newest beta version) and it's been working great for me. It sounds like a bug in the compile that's included with Mac, rather than the version of nano.

    ---
    Jayson --When Microsoft asks you, "Where do you want to go today?" tell them "Apple."



    [ Reply to This | # ]
    10.4: Recover from a 'disappearing' pico/nano
    Authored by: blgrace on Jan 12, '06 02:32:47PM

    I tried a build of 1.2.5 which suffered from the same problems as the default installed 1.2.4.
    Installing 1.3.10 seems to have fixed the problem



    [ Reply to This | # ]
    10.4: Recover from a 'disappearing' pico/nano
    Authored by: bcirvin on Jan 12, '06 02:47:06PM

    Have seen this quite a bit. For me, it was a good reason to switch primarily to vi, which is a much safer editor for most tasks (that is, it handles line breaks, etc. better than nano/pico).

    There's lots of documentation available all over the internet regarding vi - give it a shot if nano is bugging you.

    That said, vi doesn't have the easy 'ctrl-k' (cut line) option that nano does, which I use often for removing bad host keys in ~/.ssh/known-hosts



    [ Reply to This | # ]
    10.4: Recover from a 'disappearing' pico/nano
    Authored by: multiplex on Jan 12, '06 03:25:14PM

    What's wrong with 'dd' ?



    [ Reply to This | # ]
    10.4: Recover from a 'disappearing' pico/nano
    Authored by: lar3ry on Jan 13, '06 12:26:50PM

    ... or cat...?



    [ Reply to This | # ]
    10.4: Switch to vi instead
    Authored by: pepi on Jan 13, '06 04:26:39PM

    That exact behaviour of pico (-> nano) made me finally switch to vi. And good it was I did. vi takes a little practise to get used to, but in the end it's much more powerful than pico.
    You just have to be willing to learn something new! Btw. vi is part of POSIX, whereas pico or nano are not.
    Pepi



    [ Reply to This | # ]
    10.4: Recover from a 'disappearing' pico/nano
    Authored by: MacCoaster on Jan 16, '06 12:38:57AM
    What do you mean by line breaks? Try using the -w argument with pico and see if it handles line breaks to your liking.

    [ Reply to This | # ]
    10.4: Recover from a 'disappearing' pico/nano
    Authored by: midtoad on Jan 13, '06 09:34:06PM

    In addition, or instead of, vi, you can run Xemacs from a terminal. For pico and nano users, the advantage would be that you get a menu bar that you can control with a mouse, and you don't have to deal with that weird modal stuff that vi uses (vi users - and I'm one of them - please accept that newbies find vi hard to deal with - no visual prompts of any kind).

    To start Xemacs from a terminal, simply type:
    xemacs &

    The '&' says to run xemacs in the background, i.e. give you back your terminal immediately. It will launch a new window for itself.

    To check whether you have xemacs on your system, type:
    which xemacs
    Usually, if xemacs is installed, you should see something like
    /sw/bin/xemacs

    If it's not there, use:
    sudo apt-get install xemacs
    to install it.

    S


    ---
    Calgary, Alberta
    Mac Mini



    [ Reply to This | # ]
    10.4: Recover from a 'disappearing' pico/nano
    Authored by: timhaigh on Jan 14, '06 05:17:21PM
    I just installed installed the latest binary of pico for Tiger 4.64 from this page. This version fixed all the problems of the resizing window disapperance.

    [ Reply to This | # ]
    10.4: Recover from a 'disappearing' pico/nano
    Authored by: mark hunte on Feb 01, '06 05:11:04PM

    pico/nano also has a menu to reset to default size, saves guessing..

    ---
    mh



    [ Reply to This | # ]