jed-users mailing list

[2006 Date Index] [2006 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: jed in a pipe :-)


=?UTF-8?Q?J=C3=B6rg?= Sommer <joerg@xxxxxxxxxxxx> wrote:
>is it supported to use jed with stdin = /dev/null?
>
>% ls | xargs jed
>
>If jed prompts for an input while starting and you abort it with ^G jed
>dies and does not reset the terminal. http://bugs.debian.org/390160

In this case, xargs is jed's parent process.  By pressing ^G, you end
up sending it SIGINT causing xargs to die leaving jed an orphaned
process unable to access its controlling terminal.  When jed tries to
read from the terminal (/dev/tty), the read fails with errno set to
EIO.  Jed then exits with an error message and, in the process,
attempts to reset the terminal. This again fails and sets EIO to -1.
Unfortunately I see no workaround other than to disable this use
altogether, which I do not want to do.  For this reason, I do not
regard this as a jed bug.

If xargs had an option such as "--ignore-sigint", then this would not
be a problem.  For this reason, I never use xargs and use jed in this
way:

   ls | jed --stdin-files

where I have in my .jedrc file:

define stdin_files ()
{
   variable file;

   !if (bufferp ("*stdin*"))
     return;

   setbuf ("*stdin*");
   bob ();

   do
     {
        file = line_as_string ();
        if (strlen (file))
          {
             () = find_file (file);
             setbuf ("*stdin*");
          }
     }
   while (down_1 ());
}

--John

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2006 date index] [2006 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]