I am wondering if there is a different mechanism between printing user and path information(e.g. guest:~/home/guest$) and command outputs.When I try to PIPE stdin and stdout of bash, I can only get command outputs but not user and path information. self.p = Popen([bash, -i], bufsize=1, stdin=PIPE, stdout=PIPE)self.p.stderr = self.p.stdoutself.t = Thread(target=self.listen_stdout)self.t.daemon = True # thread dies with the programself.t.start()def listen_stdout(self):    while True:        c = self.p.stdout.read(1)        print c,When I run the above code and write ls to self.p.stdin, it does only print content of the folder but not guest:~/home/guest$.It goes same with password prompt of ssh and sudo.What am I missing? Any ideas?
How does 'bash' or 'gnome-terminal' print user and path information?
bash;terminal;pipe
bash has both an interactive mode and a batch mode. It enters the corresponding mode depending if stdin is a terminal or not.bash        # interactivecat|bash    # non-interactive: stdin is a pipe not a terminalcat|bash -i # explicitly request interactive modeIn interactive mode bash will print a prompt (configurable by the PS1 variable) and also set up other things for a more user friendly environment.Please read man bash and look for interactive for all the differences of those modes.