# # old-fashioned 'shl' like program # by A. Ito # # commands: # c creates new shell # C-z suspends shell # p lists all shell # 0,1,... choose shell # q quit require 'pty' $shells = [] $n_shells = 0 $r_pty = nil $w_pty = nil def writer system "stty -echo raw" begin while true c = STDIN.getc if c == 26 then # C-z $reader.raise(nil) return 'Suspend' end $w_pty.print c.chr $w_pty.flush end rescue $reader.raise(nil) return 'Exit' ensure system "stty echo -raw" end end $reader = Thread.new { while true begin next if $r_pty.nil? c = $r_pty.getc if c.nil? then Thread.stop end print c.chr STDOUT.flush rescue Thread.stop end end } # $reader.raise(nil) while true print ">> " STDOUT.flush case gets when /^c/i $shells[$n_shells] = PTY.spawn("/bin/csh") $r_pty,$w_pty = $shells[$n_shells] $n_shells += 1 $reader.run if writer == 'Exit' $n_shells -= 1 $shells[$n_shells] = nil end when /^p/i for i in 0..$n_shells unless $shells[i].nil? print i,"\n" end end when /^([0-9]+)/ n = $1.to_i if $shells[n].nil? print "\##{i} doesn't exist\n" else $r_pty,$w_pty = $shells[n] $reader.run if writer == 'Exit' then $shells[n] = nil end end when /^q/i exit end end ue='ruby_2_7'>ruby_2_7 The Ruby Programming Language
summaryrefslogtreecommitdiff
path: root/vm.c
AgeCommit message (Expand)Author
2012-10-29* thread.c: added Thread#thread_variable_(get|set),tenderlove
2012-10-27* vm.c (vm_define_method): remove type and frozen checking.ko1
2012-10-27* numeric.c (rb_float_new_in_heap), include/ruby/ruby.h:ko1
2012-10-23* vm_core.h, vm_insnhelper.c, vm_eval.c (OPT_CALL_CFUNC_WITHOUT_FRAME):ko1
2012-10-19vm.c: pass through thrown objectsnobu
2012-10-04* vm.c (vm_analysis_insn|operand|register): use st_insertko1
2012-10-04* vm.c (VM_COLLECT_USAGE_DETAILS): make new VM usage analysisko1
2012-09-28* vm_core.h: remove rb_control_frame_t::bp (bp: base pointer).ko1
2012-09-26* insns.def: add new instruction `opt_empty_p' for optimize `empty?'ko1
2012-09-24Feature #7035nobu
2012-08-23* class.c (singleton_class_of): flonum can't have singleton class.usa
2012-08-23* include/ruby/ruby.h: introduce flonum technique forko1
2012-08-22* vm_trace.c: support TracePoint. [ruby-trunk - Feature #6895]ko1
2012-08-20vm_insnhelper.c: iclass as klass in cfpnobu
2012-08-16* vm_trace.c, vm_core.h: simplify tracing mechanism.ko1
2012-08-15Kernel#inspect: improve consistency and do not call #to_s.eregon
2012-08-15Revert r36699 and r36700. [Feature #6130]naruse
2012-08-14Kernel#inspect: improve consistency and do not call #to_s.eregon
2012-08-12* vm.c (invoke_block_from_c): fix unintentional block passing.ktsj
2012-08-07* vm_exec.c, insns.def (leave): solve problems onko1
2012-08-02* eval.c (rb_mod_using): new method Module#using. [experimental]shugo
2012-08-02* class.c, insns.def, method.h, proc.c, vm.c, vm_core.h, vm_eval.c,shugo
2012-07-18vm.c: remove unused variablesnobu
2012-07-18* thread.c (rb_threadptr_async_errinfo_*): manage async errors queue.ko1
2012-07-04__callee__ fixnobu
2012-06-22* iseq.c, vm_eval.c: set th->base_block properly.ko1
2012-06-15fix typos [ci skip]kazu
2012-06-15* vm_core.h: remove VM_FRAME_MAGIC_FINISH (finish frame type).ko1
2012-06-11* vm_core.h: remove lfp (local frame pointer) and renameko1
2012-06-04* vm_core.h (rb_location_t): fix type and field name.ko1
2012-06-02* common.mk: fix to build vm_backtrace.c only itself (vm_backtrace.cko1
2012-06-02* vm_backtrace.c: added. Separate backtrace related functions toko1
2012-05-31vm.c: UNREACHABLE to suppress warningsnobu
2012-05-26* vm.c (backtrace_*): change type of lev and n from size_t to int.ko1
2012-05-26* vm.c (RubyVM::FrameInfo): add a class to access each frameko1
2012-05-26* vm.c (frame_info_to_str): add `break'.ko1
2012-05-26* vm.c (rb_frame_info_t): keep previous ISEQ frame info for CFUNCko1
2012-05-25vm.c: adjust argument typesnobu
2012-05-25* vm.c (oldbt_init, vm_backtrace_str_ary): arg->data shouldko1
2012-05-25* vm.c: refactoring backtrace related funcitons.ko1
2012-05-24vm.c: marshal compatibilitynobu
2012-05-24vm.c: fix typonobu
2012-05-24vm.c: rb_typeddata_is_kind_ofnobu
2012-05-24vm_eval.c: fix typesnobu
2012-05-24vm.c: suppress 64-to-32 warningsnobu
2012-05-24* vm.c: add RubyVM::Backtrace object (btobj).ko1
2012-05-22* vm_core.h: add a data type rb_location_t to store iseq locationko1
2012-04-28* parse.y (assoc, parser_yylex): add syntax to splat keyword hash.nobu
2012-04-12* compile.c (compile_array, compile_array_):ko1
2012-02-15* cont.c (rb_fiber_reset_root_local_storage): add a new function tonagachika