Project

General

Profile

Actions

Bug #12312

closed

Make PTY take environment variables like popen does

Bug #12312: Make PTY take environment variables like popen does

Added by grosser (Michael Grosser) almost 10 years ago. Updated almost 4 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:75144]

Description

Need a PTY that also takes environment variables ... hacking around it with script (which works differently on OSX and Unix) is ugly ...

Updated by nobu (Nobuyoshi Nakada) almost 10 years ago Actions #1 [ruby-core:75251]

  • Status changed from Open to Closed
  • Backport changed from 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN to 2.1: DONTNEED, 2.2: DONTNEED, 2.3: DONTNEED

It works already.

$ ruby1.9 -v -rpty -e 'PTY.spawn({"FOO"=>"bar"}, "printenv", "FOO") {|r,w,pid|p r.read}'
ruby 1.9.3p551 (2014-11-13 revision 48407) [universal.x86_64-darwin15.3.0]
"bar\r\n"

Updated by st0012 (Stan Lo) almost 4 years ago Actions #2 [ruby-core:108222]

FYI, I have updated PTY.spawn's doc for the optional env argument.

Actions

Also available in: PDF Atom