nelhage / reptyr

Reparent a running program to a new terminal
MIT License
5.78k stars 216 forks source link

Flush stdout after "Opened a new pty: " message. #20

Closed vi closed 12 years ago

vi commented 12 years ago

Allows usage of reptry in scripts and other programs.

nelhage commented 12 years ago

Thanks, merged.

vi commented 12 years ago

Also pushed more extensive scripting support with fork/exec and REPTYR_* envionment variables.

nelhage commented 12 years ago

I like the concept. Is there a reason to have the $REPTYR_REDIRECT environment variable, instead of a command-line option?

Also, out of curiosity, what's your use case for this?

On Thu, Aug 16, 2012 at 11:43 AM, Vitaly Shukela notifications@github.com wrote:

Also pushed more extensive scripting support with fork/exec and REPTYR_* envionment variables.

— Reply to this email directly or view it on GitHub.

vi commented 12 years ago

Already pushed one more commit that makes '-L' alias to '-l' with REDIRECT.

In my programs I use environment variables for configuration more than non-positional arguments.

Use case: start programs that can clobber terminal or steal it's ownership. Example: http://github.com/vi/dive After starting it in usual mode the calling shell loses terminal owner status. But with "reptry -L" the problem is worked around.

vi commented 12 years ago

(Now thinking what to put to dive's documentation... "Use special vi's version of reptyr" or "Use reptry not less that v0.4")

nelhage commented 12 years ago

What do you think of this: https://github.com/nelhage/reptyr/tree/subcommand

I'm happy to do an 0.4 release with this feature once we merge it.

On Thu, Aug 16, 2012 at 11:56 AM, Vitaly Shukela notifications@github.comwrote:

(Now thinking what to put to dive's documentation... "Use special vi's version of reptyr" or "Use reptry not less that v0.4")

— Reply to this email directly or view it on GitHubhttps://github.com/nelhage/reptyr/pull/20#issuecomment-7789829.

vi commented 12 years ago

"dive" successfully works with "subcommand" version of reptyr.

/* Some area of improvement: it would be good if "reptyr -L bash" could work like "socat -,raw,echo=0 exec:bash,pty,setsid,stderr". The latter gives job control in the shell, the former gives normal terminal resizing. I want both. */

nelhage commented 12 years ago

Just pushed a commit that I think will fix that. Let me know if it works.

On Thu, Aug 16, 2012 at 12:38 PM, Vitaly Shukela notifications@github.comwrote:

"dive" successfully works with "subcommand" version of reptyr.

/* Some area of improvement: it would be good if "reptyr -L bash" could work like "socat -,raw,echo=0 exec:bash,pty,setsid,stderr". The latter gives job control in the shell, the former gives normal terminal resizing. I want both. */

— Reply to this email directly or view it on GitHubhttps://github.com/nelhage/reptyr/pull/20#issuecomment-7791196.

vi commented 12 years ago

Works. Documented one more "reptyr" workaround in "dive" (in addition to that socat's).

That "Opened a new pty: /dev/pts/33" probably should not be displayed at all in "-L" mode.

nelhage commented 12 years ago

Great. I've pushed to master and tagged 0.4.

On Thu, Aug 16, 2012 at 1:13 PM, Vitaly Shukela notifications@github.comwrote:

Works. Documented one more "reptyr" workaround in "dive" (in addition to that socat's).

— Reply to this email directly or view it on GitHubhttps://github.com/nelhage/reptyr/pull/20#issuecomment-7792230.