Re: [dev] [st] Start with text already input

From: Hadrien Lacour <hadrien.lacour_AT_posteo.net>
Date: Sat, 16 Sep 2017 00:08:37 +0200

On Fri, Sep 15, 2017 at 09:24:55PM +0000, Eric Pruitt wrote:
> On Fri, Sep 15, 2017 at 09:41:32PM +0200, Hadrien Lacour wrote:
> > I basically wanted a way to open a terminal with the beginning of a
> > command ("pass -c " in my case) already typed.
> >
> > I finally settled for the dmenu integration, but this still could be
> > useful. I'll probably have better chance with xdotool.
>
> The only method I'm aware of for pushing characters to a terminal
> requires using ioctl, and I think (but am not certain) this only works
> if the process in question is the session leader. In C, this looks like
> "ioctl(tty, TIOCSTI, data)" where "tty" is a file descriptor for the
> terminal. Maybe you could create a wrapper program that uses ioctl to
> push bytes into the input buffer then spawns a shell.
>
> Eric
>

Thanks, it works perfectly. Too bad termios doesn't seem to make this possible.
Also, understandably, it only works on the current tty (probably what you meant
by "session leader").
Received on Sat Sep 16 2017 - 00:08:37 CEST

This archive was generated by hypermail 2.3.0 : Sat Sep 16 2017 - 00:12:28 CEST