Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to stop opening a new terminal window for each command? #9

Open
evandrocoan opened this issue Jul 30, 2017 · 1 comment
Open

How to stop opening a new terminal window for each command? #9

evandrocoan opened this issue Jul 30, 2017 · 1 comment

Comments

@evandrocoan
Copy link

I am import this like this:

import os
import sys

current_directory = os.path.dirname( os.path.realpath( __file__ ) )
sys.path.insert( 0, os.path.join( current_directory, 'find_forks/six' ) )
sys.path.insert( 0, os.path.join( current_directory, 'find_forks/find_forks' ) )

from find_forks import find_forks
...
            user, repository = parse_upstream( upstream )
            find_forks( user, repository )

But for each git command command it do, it open a new shell terminal window.

@evandrocoan
Copy link
Author

I was using it as a Package inside Sublime Text. I figured out to fix is necessary to a pipe call with the following:

                with subprocess.Popen(
                    args,
                    stdin=subprocess.PIPE,
                    stdout=subprocess.PIPE,
                    stderr=subprocess.STDOUT,
                    startupinfo=startupinfo,
                    cwd=cwd,
                    env=os.environ
                ) as proc:
                    for line in proc.stdout:
                        line = line.decode(encoding)
                        line = line.replace('\r\n', '\n').rstrip(' \n\r')

                        # process line here
                        print(line)
  1. Commit: evandrocoan/PackagesManager@d4ea0f5

evandrocoan added a commit to evandrocoan/channelmanager that referenced this issue Jul 31, 2017
evandrocoan added a commit to evandrocoan/channelmanager that referenced this issue Aug 2, 2017
evandrocoan added a commit to evandrocoan/channelmanager that referenced this issue Oct 2, 2017
evandrocoan added a commit to evandrocoan/StudioChannel that referenced this issue Oct 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant