Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

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

Closed
wants to merge 1 commit into from

2 participants

Vitaly Shukela Nelson Elhage
Vitaly Shukela
vi commented

Allows usage of reptry in scripts and other programs.

Vitaly Shukela vi Flush stdout after printing "Opened a new pty:" message
Allows usage of reptry in scripts and other programs
bfc86cd
Nelson Elhage
Owner

Thanks, merged.

Nelson Elhage nelhage closed this
Vitaly Shukela
vi commented

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

Nelson Elhage
Owner
Vitaly Shukela
vi commented

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.

Vitaly Shukela
vi commented

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

Nelson Elhage
Owner
Vitaly Shukela
vi commented

"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. */

Nelson Elhage
Owner
Vitaly Shukela
vi commented

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.

Nelson Elhage
Owner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Aug 16, 2012
Vitaly Shukela vi Flush stdout after printing "Opened a new pty:" message
Allows usage of reptry in scripts and other programs
bfc86cd
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 1 addition and 0 deletions. Show diff stats Hide diff stats

  1. +1 0  reptyr.c
1  reptyr.c
@@ -245,6 +245,7 @@ int main(int argc, char **argv) {
245 245 }
246 246 } else {
247 247 printf("Opened a new pty: %s\n", ptsname(pty));
  248 + fflush(stdout);
248 249 }
249 250
250 251 setup_raw(&saved_termios);

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.