[lib/irb] Explicitly join on "" so $, does not change error message outputs#1140
[lib/irb] Explicitly join on "" so $, does not change error message outputs#1140sampersand wants to merge 1 commit intoruby:masterfrom
Conversation
|
cf ruby/reline#866 for the reline one |
|
There are more One way to fully support overriding module IRB
class WorkSpace
def evaluate(statements, file = __FILE__, line = __LINE__)
$, = somewhere.stored_dollar_comma
eval(statements, @binding, file, line)
somewhere.stored_dollar_comma = $,
$, = nil
end
end
endBut I'm not confident if we should really support it. Changing For what is worth, Ruby 4.0 ships with Ruby::Box that can make a sandbox-like environment. |
This PR does a minor change to
lib/irb.rbso that the.joindone on error messages doesn't use$,. I use$,occasionally when debugging some older scripts, and having IRB's error messages use it is a bit annoying.I've made another PR to
relinewhich solves a much more egregious problem (it does this joining when printing chars out in prompts!)Before
After