Opened 14 years ago

Closed 4 years ago

#25750 closed defect (duplicate)

nvi doesn't work with 'port edit'

Reported by: geoffl@… Owned by: tobypeterson
Priority: Normal Milestone:
Component: ports Version: 1.9.1
Keywords: Cc:
Port: nvi

Description

When I try to run "port edit" with nvi as the editor, this is what happens:

 $ sudo port edit --editor nvi nvi
Error: unable to invoke editor nvi: ./ja_JP.UTF-8: No such file or directory
 $

the error message is a known bug, at least in MacPorts, but I can still use nvi normally. However, if I invoke with port edit then it refuses to start. Maybe it's due to the error message?

To get rid of the message, one can run without locale, by unsetting the locale, but then I get this if I use it in conjunction with port edit:

$ unset LANG
$ sudo port edit nvi
Error: unable to invoke editor vi: child killed: segmentation violation
$

Change History (5)

comment:1 Changed 14 years ago by jmroot (Joshua Root)

Component: baseports
Owner: changed from macports-tickets@… to toby@…
Port: nvi added
Summary: port edit doesn't work with nvinvi doesn't work with 'port edit'

I can get port to exit with an error if the editor prints to stderr, but only after the editor exits, so it doesn't actually prevent editing from working. This seems more like a bug with the nvi port.

comment:2 Changed 14 years ago by geoffl@…

One thing that I probably didn't make very clear was that the "port edit" command would bail out early in the first of the two cases given, so you won't be able to actually edit anything. The latter case obviously is a bug in nvi. In either case, starting nvi as a standalone program on the command line works fine.

I haven't looked too closely at why the nvi screen never comes up, I guess editors should be able to print to stderr anytime they want, for diagnostic or non-fatal error message (such as this one), is the port command bailing out early because it detected something on stderr? It might be better to just start the editor and wait for it to finish. I tried vipw and visudo with nvi both of which shell out to the external editor for modifications, and nvi comes up fine.

comment:3 Changed 14 years ago by jmroot (Joshua Root)

Sorry if I worded it poorly, but my point above was that I couldn't get port to bail before the editor had a chance to run, but only after I deliberately closed the editor. I committed a fix for the (Tcl default) behaviour of considering writing to stderr to indicate failure in r69887, so you can try a trunk build and see what happens. I think there's more to this though.

comment:4 Changed 14 years ago by geoffl@…

Thanks, that seems to have done the trick.

I'll leave it open because the latter is apparently a bug in nvi.

comment:5 Changed 4 years ago by tobypeterson

Resolution: duplicate
Status: newclosed

Locale issue covered by #25733

Crash was fixed by #25732

Note: See TracTickets for help on using tickets.