brakeman 6.2.2 → 7.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES.md +26 -0
- data/README.md +1 -1
- data/bundle/load.rb +10 -8
- data/bundle/ruby/3.1.0/gems/csv-3.3.3/LICENSE.txt +33 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.3/NEWS.md +990 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.3/README.md +55 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.3/lib/csv/core_ext/array.rb +9 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.3/lib/csv/core_ext/string.rb +9 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.3/lib/csv/fields_converter.rb +96 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.3/lib/csv/input_record_separator.rb +18 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.3/lib/csv/parser.rb +1302 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.3/lib/csv/row.rb +757 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.3/lib/csv/table.rb +1055 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.3/lib/csv/version.rb +6 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.3/lib/csv/writer.rb +209 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.3/lib/csv.rb +3017 -0
- data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/Changelog.md +4 -0
- data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/Gemfile +1 -0
- data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/list_renderer.rb +2 -2
- data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/menu.rb +7 -5
- data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/version.rb +1 -1
- data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline.rb +17 -12
- data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/config.rb +22 -26
- data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/history.rb +3 -3
- data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/io/ansi.rb +64 -111
- data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/io/dumb.rb +16 -2
- data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/io/windows.rb +77 -60
- data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/io.rb +14 -0
- data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/key_actor/base.rb +10 -4
- data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/key_actor/emacs.rb +96 -96
- data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/key_actor/vi_command.rb +182 -182
- data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/key_actor/vi_insert.rb +137 -137
- data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/key_stroke.rb +26 -16
- data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/line_editor.rb +238 -404
- data/bundle/ruby/3.1.0/gems/reline-0.6.0/lib/reline/unicode.rb +415 -0
- data/bundle/ruby/3.1.0/gems/reline-0.6.0/lib/reline/version.rb +3 -0
- data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline.rb +18 -18
- data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/NEWS.md +74 -0
- data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/parsers/baseparser.rb +78 -48
- data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/parsers/pullparser.rb +4 -0
- data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/rexml.rb +1 -1
- data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/source.rb +61 -6
- data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/text.rb +15 -40
- data/bundle/ruby/3.1.0/gems/{ruby2ruby-2.5.1 → ruby2ruby-2.5.2}/History.rdoc +6 -0
- data/bundle/ruby/3.1.0/gems/{ruby2ruby-2.5.1 → ruby2ruby-2.5.2}/lib/ruby2ruby.rb +7 -4
- data/bundle/ruby/3.1.0/gems/{sexp_processor-4.17.2 → sexp_processor-4.17.3}/History.rdoc +6 -0
- data/bundle/ruby/3.1.0/gems/{sexp_processor-4.17.2 → sexp_processor-4.17.3}/lib/sexp.rb +1 -1
- data/bundle/ruby/3.1.0/gems/{sexp_processor-4.17.2 → sexp_processor-4.17.3}/lib/sexp_processor.rb +1 -1
- data/bundle/ruby/3.1.0/gems/terminal-table-4.0.0/History.rdoc +149 -0
- data/bundle/ruby/3.1.0/gems/terminal-table-4.0.0/README.md +417 -0
- data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-4.0.0}/lib/terminal-table/cell.rb +9 -9
- data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-4.0.0}/lib/terminal-table/row.rb +18 -4
- data/bundle/ruby/3.1.0/gems/terminal-table-4.0.0/lib/terminal-table/separator.rb +66 -0
- data/bundle/ruby/3.1.0/gems/terminal-table-4.0.0/lib/terminal-table/style.rb +284 -0
- data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-4.0.0}/lib/terminal-table/table.rb +49 -18
- data/bundle/ruby/3.1.0/gems/terminal-table-4.0.0/lib/terminal-table/util.rb +13 -0
- data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-4.0.0}/lib/terminal-table/version.rb +1 -1
- data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-4.0.0}/lib/terminal-table.rb +2 -2
- data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-4.0.0}/terminal-table.gemspec +3 -4
- data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/creole.rb +2 -0
- data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/liquid.rb +0 -3
- data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/mapping.rb +3 -3
- data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/rdoc.rb +0 -8
- data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/template.rb +178 -27
- data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt.rb +9 -4
- data/bundle/ruby/3.1.0/gems/unicode-display_width-3.1.4/CHANGELOG.md +291 -0
- data/bundle/ruby/3.1.0/gems/{unicode-display_width-1.8.0 → unicode-display_width-3.1.4}/MIT-LICENSE.txt +1 -1
- data/bundle/ruby/3.1.0/gems/unicode-display_width-3.1.4/README.md +194 -0
- data/bundle/ruby/3.1.0/gems/unicode-display_width-3.1.4/data/display_width.marshal.gz +0 -0
- data/bundle/ruby/3.1.0/gems/unicode-display_width-3.1.4/lib/unicode/display_width/constants.rb +10 -0
- data/bundle/ruby/3.1.0/gems/unicode-display_width-3.1.4/lib/unicode/display_width/emoji_support.rb +52 -0
- data/bundle/ruby/3.1.0/gems/unicode-display_width-3.1.4/lib/unicode/display_width/index.rb +34 -0
- data/bundle/ruby/3.1.0/gems/unicode-display_width-3.1.4/lib/unicode/display_width/no_string_ext.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-display_width-3.1.4/lib/unicode/display_width/reline_ext.rb +14 -0
- data/bundle/ruby/3.1.0/gems/unicode-display_width-3.1.4/lib/unicode/display_width/string_ext.rb +9 -0
- data/bundle/ruby/3.1.0/gems/unicode-display_width-3.1.4/lib/unicode/display_width.rb +247 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/CHANGELOG.md +191 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/CODE_OF_CONDUCT.md +74 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/Gemfile +7 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/Gemfile.lock +33 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/MIT-LICENSE.txt +20 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/README.md +205 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/data/emoji.marshal.gz +0 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/data/generate_constants.rb +344 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/constants.rb +49 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_basic.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_emoji_keycap.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_include_mqe.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_include_mqe_uqe.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_include_text.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_picto.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_picto_no_emoji.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_possible.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_prop_component.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_prop_emoji.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_prop_modifier.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_prop_modifier_base.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_prop_presentation.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_text.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_text_presentation.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_valid.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_valid_include_text.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_well_formed.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_well_formed_include_text.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_basic.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_emoji_keycap.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_include_mqe.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_include_mqe_uqe.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_include_text.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_picto.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_picto_no_emoji.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_possible.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_prop_component.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_prop_emoji.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_prop_modifier.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_prop_modifier_base.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_prop_presentation.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_text.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_text_presentation.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_valid.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_valid_include_text.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_well_formed.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_well_formed_include_text.rb +8 -0
- data/bundle/ruby/3.1.0/gems/{unicode-display_width-1.8.0/lib/unicode/display_width → unicode-emoji-4.0.4/lib/unicode/emoji}/index.rb +5 -3
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/lazy_constants.rb +56 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/list.rb +13 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji.rb +111 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/unicode-emoji.gemspec +22 -0
- data/lib/brakeman/app_tree.rb +29 -19
- data/lib/brakeman/checks/check_deserialize.rb +4 -1
- data/lib/brakeman/checks/check_evaluation.rb +45 -8
- data/lib/brakeman/checks/check_model_attr_accessible.rb +1 -0
- data/lib/brakeman/checks/check_weak_rsa_key.rb +1 -1
- data/lib/brakeman/file_parser.rb +2 -1
- data/lib/brakeman/options.rb +12 -5
- data/lib/brakeman/processors/alias_processor.rb +9 -4
- data/lib/brakeman/processors/lib/file_type_detector.rb +9 -7
- data/lib/brakeman/report/ignore/config.rb +0 -1
- data/lib/brakeman/report/report_sarif.rb +122 -2
- data/lib/brakeman/rescanner.rb +40 -390
- data/lib/brakeman/scanner.rb +84 -51
- data/lib/brakeman/tracker/file_cache.rb +83 -0
- data/lib/brakeman/tracker.rb +19 -2
- data/lib/brakeman/version.rb +1 -1
- data/lib/brakeman.rb +19 -2
- metadata +265 -199
- data/bundle/ruby/3.1.0/gems/reline-0.5.10/lib/reline/terminfo.rb +0 -158
- data/bundle/ruby/3.1.0/gems/reline-0.5.10/lib/reline/unicode.rb +0 -671
- data/bundle/ruby/3.1.0/gems/reline-0.5.10/lib/reline/version.rb +0 -3
- data/bundle/ruby/3.1.0/gems/terminal-table-1.8.0/History.rdoc +0 -85
- data/bundle/ruby/3.1.0/gems/terminal-table-1.8.0/README.rdoc +0 -247
- data/bundle/ruby/3.1.0/gems/terminal-table-1.8.0/lib/terminal-table/separator.rb +0 -14
- data/bundle/ruby/3.1.0/gems/terminal-table-1.8.0/lib/terminal-table/style.rb +0 -79
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/erubis.rb +0 -51
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/maruku.rb +0 -10
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/wikicloth.rb +0 -12
- data/bundle/ruby/3.1.0/gems/unicode-display_width-1.8.0/CHANGELOG.md +0 -137
- data/bundle/ruby/3.1.0/gems/unicode-display_width-1.8.0/README.md +0 -124
- data/bundle/ruby/3.1.0/gems/unicode-display_width-1.8.0/data/display_width.marshal.gz +0 -0
- data/bundle/ruby/3.1.0/gems/unicode-display_width-1.8.0/lib/unicode/display_width/constants.rb +0 -8
- data/bundle/ruby/3.1.0/gems/unicode-display_width-1.8.0/lib/unicode/display_width/no_string_ext.rb +0 -7
- data/bundle/ruby/3.1.0/gems/unicode-display_width-1.8.0/lib/unicode/display_width/string_ext.rb +0 -17
- data/bundle/ruby/3.1.0/gems/unicode-display_width-1.8.0/lib/unicode/display_width.rb +0 -51
- /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/AUTHORS +0 -0
- /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/COPYING +0 -0
- /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/LICENSE +0 -0
- /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/README.md +0 -0
- /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/TODO +0 -0
- /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/highline.gemspec +0 -0
- /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/builtin_styles.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/color_scheme.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/compatibility.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/custom_errors.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/import.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/io_console_compatible.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/list.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/menu/item.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/paginator.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/question/answer_converter.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/question.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/question_asker.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/simulate.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/statement.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/string.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/string_extensions.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/style.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/template_renderer.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/terminal/io_console.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/terminal/ncurses.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/terminal/unix_stty.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/terminal.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/wrapper.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/BSDL +0 -0
- /data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/COPYING +0 -0
- /data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/README.md +0 -0
- /data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/face.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/key_actor/composite.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/key_actor.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/kill_ring.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/unicode/east_asian_width.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/license_of_rb-readline +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/LICENSE.txt +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/README.md +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/attlistdecl.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/attribute.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/cdata.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/child.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/comment.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/doctype.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/document.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/dtd/attlistdecl.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/dtd/dtd.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/dtd/elementdecl.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/dtd/entitydecl.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/dtd/notationdecl.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/element.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/encoding.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/entity.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/formatters/default.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/formatters/pretty.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/formatters/transitive.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/functions.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/instruction.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/light/node.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/namespace.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/node.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/output.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/parent.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/parseexception.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/parsers/lightparser.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/parsers/sax2parser.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/parsers/streamparser.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/parsers/treeparser.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/parsers/ultralightparser.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/parsers/xpathparser.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/quickpath.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/sax2listener.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/security.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/streamlistener.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/undefinednamespaceexception.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/validation/relaxng.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/validation/validation.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/validation/validationexception.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/xmldecl.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/xmltokens.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/xpath.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/xpath_parser.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{ruby2ruby-2.5.1 → ruby2ruby-2.5.2}/Manifest.txt +0 -0
- /data/bundle/ruby/3.1.0/gems/{ruby2ruby-2.5.1 → ruby2ruby-2.5.2}/README.rdoc +0 -0
- /data/bundle/ruby/3.1.0/gems/{sexp_processor-4.17.2 → sexp_processor-4.17.3}/Manifest.txt +0 -0
- /data/bundle/ruby/3.1.0/gems/{sexp_processor-4.17.2 → sexp_processor-4.17.3}/README.rdoc +0 -0
- /data/bundle/ruby/3.1.0/gems/{sexp_processor-4.17.2 → sexp_processor-4.17.3}/lib/composite_sexp_processor.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{sexp_processor-4.17.2 → sexp_processor-4.17.3}/lib/pt_testcase.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{sexp_processor-4.17.2 → sexp_processor-4.17.3}/lib/sexp_matcher.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{sexp_processor-4.17.2 → sexp_processor-4.17.3}/lib/strict_sexp.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{sexp_processor-4.17.2 → sexp_processor-4.17.3}/lib/unique.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-4.0.0}/Gemfile +0 -0
- /data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-4.0.0}/LICENSE.txt +0 -0
- /data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-4.0.0}/Manifest +0 -0
- /data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-4.0.0}/Todo.rdoc +0 -0
- /data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-4.0.0}/lib/terminal-table/import.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-4.0.0}/lib/terminal-table/table_helper.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/COPYING +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/_emacs_org.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/_handlebars.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/_jbuilder.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/_org.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/asciidoc.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/babel.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/builder.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/cli.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/coffee.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/commonmarker.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/csv.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/erb.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/erubi.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/etanni.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/haml.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/kramdown.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/livescript.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/markaby.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/nokogiri.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/pandoc.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/pipeline.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/plain.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/prawn.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/radius.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/rdiscount.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/redcarpet.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/redcloth.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/rst-pandoc.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/sass.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/slim.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/string.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/typescript.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/yajl.rb +0 -0
@@ -1,6 +1,9 @@
|
|
1
1
|
require 'fiddle/import'
|
2
2
|
|
3
3
|
class Reline::Windows < Reline::IO
|
4
|
+
|
5
|
+
attr_writer :output
|
6
|
+
|
4
7
|
def initialize
|
5
8
|
@input_buf = []
|
6
9
|
@output_buf = []
|
@@ -52,7 +55,6 @@ class Reline::Windows < Reline::IO
|
|
52
55
|
[224, 83] => :key_delete, # Del
|
53
56
|
[224, 71] => :ed_move_to_beg, # Home
|
54
57
|
[224, 79] => :ed_move_to_end, # End
|
55
|
-
[ 0, 41] => :ed_unassigned, # input method on/off
|
56
58
|
[ 0, 72] => :ed_prev_history, # ↑
|
57
59
|
[ 0, 80] => :ed_next_history, # ↓
|
58
60
|
[ 0, 77] => :ed_next_char, # →
|
@@ -157,6 +159,7 @@ class Reline::Windows < Reline::IO
|
|
157
159
|
STD_OUTPUT_HANDLE = -11
|
158
160
|
FILE_TYPE_PIPE = 0x0003
|
159
161
|
FILE_NAME_INFO = 2
|
162
|
+
ENABLE_WRAP_AT_EOL_OUTPUT = 2
|
160
163
|
ENABLE_VIRTUAL_TERMINAL_PROCESSING = 4
|
161
164
|
|
162
165
|
# Calling Win32API with console handle is reported to fail after executing some external command.
|
@@ -170,7 +173,7 @@ class Reline::Windows < Reline::IO
|
|
170
173
|
end
|
171
174
|
|
172
175
|
private def getconsolemode
|
173
|
-
mode = "\
|
176
|
+
mode = +"\0\0\0\0"
|
174
177
|
call_with_console_handle(@GetConsoleMode, mode)
|
175
178
|
mode.unpack1('L')
|
176
179
|
end
|
@@ -252,7 +255,7 @@ class Reline::Windows < Reline::IO
|
|
252
255
|
|
253
256
|
key = KeyEventRecord.new(virtual_key_code, char_code, control_key_state)
|
254
257
|
|
255
|
-
match = KEY_MAP.find { |args,| key.
|
258
|
+
match = KEY_MAP.find { |args,| key.match?(**args) }
|
256
259
|
unless match.nil?
|
257
260
|
@output_buf.concat(match.last)
|
258
261
|
return
|
@@ -307,6 +310,14 @@ class Reline::Windows < Reline::IO
|
|
307
310
|
yield
|
308
311
|
end
|
309
312
|
|
313
|
+
def write(string)
|
314
|
+
@output.write(string)
|
315
|
+
end
|
316
|
+
|
317
|
+
def buffered_output
|
318
|
+
yield
|
319
|
+
end
|
320
|
+
|
310
321
|
def getc(_timeout_second)
|
311
322
|
check_input_event
|
312
323
|
@output_buf.shift
|
@@ -344,35 +355,38 @@ class Reline::Windows < Reline::IO
|
|
344
355
|
# [18,2] dwMaximumWindowSize.X
|
345
356
|
# [20,2] dwMaximumWindowSize.Y
|
346
357
|
csbi = 0.chr * 22
|
347
|
-
|
348
|
-
|
358
|
+
if call_with_console_handle(@GetConsoleScreenBufferInfo, csbi) != 0
|
359
|
+
# returns [width, height, x, y, attributes, left, top, right, bottom]
|
360
|
+
csbi.unpack("s9")
|
361
|
+
else
|
362
|
+
return nil
|
363
|
+
end
|
349
364
|
end
|
350
365
|
|
366
|
+
ALTERNATIVE_CSBI = [80, 24, 0, 0, 7, 0, 0, 79, 23].freeze
|
367
|
+
|
351
368
|
def get_screen_size
|
352
|
-
|
353
|
-
|
354
|
-
end
|
355
|
-
csbi[0, 4].unpack('SS').reverse
|
369
|
+
width, _, _, _, _, _, top, _, bottom = get_console_screen_buffer_info || ALTERNATIVE_CSBI
|
370
|
+
[bottom - top + 1, width]
|
356
371
|
end
|
357
372
|
|
358
373
|
def cursor_pos
|
359
|
-
|
360
|
-
|
361
|
-
end
|
362
|
-
x = csbi[4, 2].unpack1('s')
|
363
|
-
y = csbi[6, 2].unpack1('s')
|
364
|
-
Reline::CursorPos.new(x, y)
|
374
|
+
_, _, x, y, _, _, top, = get_console_screen_buffer_info || ALTERNATIVE_CSBI
|
375
|
+
Reline::CursorPos.new(x, y - top)
|
365
376
|
end
|
366
377
|
|
367
378
|
def move_cursor_column(val)
|
368
|
-
|
379
|
+
_, _, _, y, = get_console_screen_buffer_info
|
380
|
+
call_with_console_handle(@SetConsoleCursorPosition, y * 65536 + val) if y
|
369
381
|
end
|
370
382
|
|
371
383
|
def move_cursor_up(val)
|
372
384
|
if val > 0
|
373
|
-
|
385
|
+
_, _, x, y, _, _, top, = get_console_screen_buffer_info
|
386
|
+
return unless y
|
387
|
+
y = (y - top) - val
|
374
388
|
y = 0 if y < 0
|
375
|
-
call_with_console_handle(@SetConsoleCursorPosition, y * 65536 +
|
389
|
+
call_with_console_handle(@SetConsoleCursorPosition, (y + top) * 65536 + x)
|
376
390
|
elsif val < 0
|
377
391
|
move_cursor_down(-val)
|
378
392
|
end
|
@@ -380,58 +394,39 @@ class Reline::Windows < Reline::IO
|
|
380
394
|
|
381
395
|
def move_cursor_down(val)
|
382
396
|
if val > 0
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
y =
|
387
|
-
|
397
|
+
_, _, x, y, _, _, top, _, bottom = get_console_screen_buffer_info
|
398
|
+
return unless y
|
399
|
+
screen_height = bottom - top
|
400
|
+
y = (y - top) + val
|
401
|
+
y = screen_height if y > screen_height
|
402
|
+
call_with_console_handle(@SetConsoleCursorPosition, (y + top) * 65536 + x)
|
388
403
|
elsif val < 0
|
389
404
|
move_cursor_up(-val)
|
390
405
|
end
|
391
406
|
end
|
392
407
|
|
393
408
|
def erase_after_cursor
|
394
|
-
|
395
|
-
|
396
|
-
cursor = csbi[4, 4].unpack1('L')
|
409
|
+
width, _, x, y, attributes, = get_console_screen_buffer_info
|
410
|
+
return unless x
|
397
411
|
written = 0.chr * 4
|
398
|
-
call_with_console_handle(@FillConsoleOutputCharacter, 0x20,
|
399
|
-
call_with_console_handle(@FillConsoleOutputAttribute, attributes,
|
400
|
-
end
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
if @legacy_console || window_left != 0
|
410
|
-
# unless ENABLE_VIRTUAL_TERMINAL,
|
411
|
-
# if srWindow.Left != 0 then it's conhost.exe hosted console
|
412
|
-
# and puts "\n" causes horizontal scroll. its glitch.
|
413
|
-
# FYI irb write from culumn 1, so this gives no gain.
|
414
|
-
scroll_rectangle = [0, val, buffer_width, buffer_lines - val].pack('s4')
|
415
|
-
destination_origin = 0 # y * 65536 + x
|
416
|
-
fill = [' '.ord, attributes].pack('SS')
|
417
|
-
call_with_console_handle(@ScrollConsoleScreenBuffer, scroll_rectangle, nil, destination_origin, fill)
|
418
|
-
else
|
419
|
-
origin_x = x + 1
|
420
|
-
origin_y = y - window_top + 1
|
421
|
-
@output.write [
|
422
|
-
(origin_y != screen_height) ? "\e[#{screen_height};H" : nil,
|
423
|
-
"\n" * val,
|
424
|
-
(origin_y != screen_height or !x.zero?) ? "\e[#{origin_y};#{origin_x}H" : nil
|
425
|
-
].join
|
426
|
-
end
|
412
|
+
call_with_console_handle(@FillConsoleOutputCharacter, 0x20, width - x, y * 65536 + x, written)
|
413
|
+
call_with_console_handle(@FillConsoleOutputAttribute, attributes, width - x, y * 65536 + x, written)
|
414
|
+
end
|
415
|
+
|
416
|
+
# This only works when the cursor is at the bottom of the scroll range
|
417
|
+
# For more details, see https://github.com/ruby/reline/pull/577#issuecomment-1646679623
|
418
|
+
def scroll_down(x)
|
419
|
+
return if x.zero?
|
420
|
+
# We use `\n` instead of CSI + S because CSI + S would cause https://github.com/ruby/reline/issues/576
|
421
|
+
@output.write "\n" * x
|
427
422
|
end
|
428
423
|
|
429
424
|
def clear_screen
|
430
425
|
if @legacy_console
|
431
|
-
|
432
|
-
|
433
|
-
fill_length =
|
434
|
-
screen_topleft =
|
426
|
+
width, _, _, _, attributes, _, top, _, bottom = get_console_screen_buffer_info
|
427
|
+
return unless width
|
428
|
+
fill_length = width * (bottom - top + 1)
|
429
|
+
screen_topleft = top * 65536
|
435
430
|
written = 0.chr * 4
|
436
431
|
call_with_console_handle(@FillConsoleOutputCharacter, 0x20, fill_length, screen_topleft, written)
|
437
432
|
call_with_console_handle(@FillConsoleOutputAttribute, attributes, fill_length, screen_topleft, written)
|
@@ -472,6 +467,28 @@ class Reline::Windows < Reline::IO
|
|
472
467
|
# do nothing
|
473
468
|
end
|
474
469
|
|
470
|
+
def disable_auto_linewrap(setting = true, &block)
|
471
|
+
mode = getconsolemode
|
472
|
+
if 0 == (mode & ENABLE_VIRTUAL_TERMINAL_PROCESSING)
|
473
|
+
if block
|
474
|
+
begin
|
475
|
+
setconsolemode(mode & ~ENABLE_WRAP_AT_EOL_OUTPUT)
|
476
|
+
block.call
|
477
|
+
ensure
|
478
|
+
setconsolemode(mode | ENABLE_WRAP_AT_EOL_OUTPUT)
|
479
|
+
end
|
480
|
+
else
|
481
|
+
if setting
|
482
|
+
setconsolemode(mode & ~ENABLE_WRAP_AT_EOL_OUTPUT)
|
483
|
+
else
|
484
|
+
setconsolemode(mode | ENABLE_WRAP_AT_EOL_OUTPUT)
|
485
|
+
end
|
486
|
+
end
|
487
|
+
else
|
488
|
+
block.call if block
|
489
|
+
end
|
490
|
+
end
|
491
|
+
|
475
492
|
class KeyEventRecord
|
476
493
|
|
477
494
|
attr_reader :virtual_key_code, :char_code, :control_key_state, :control_keys
|
@@ -501,7 +518,7 @@ class Reline::Windows < Reline::IO
|
|
501
518
|
# Verifies if the arguments match with this key event.
|
502
519
|
# Nil arguments are ignored, but at least one must be passed as non-nil.
|
503
520
|
# To verify that no control keys were pressed, pass an empty array: `control_keys: []`.
|
504
|
-
def
|
521
|
+
def match?(control_keys: nil, virtual_key_code: nil, char_code: nil)
|
505
522
|
raise ArgumentError, 'No argument was passed to match key event' if control_keys.nil? && virtual_key_code.nil? && char_code.nil?
|
506
523
|
|
507
524
|
(control_keys.nil? || [*control_keys].sort == @control_keys) &&
|
@@ -35,6 +35,20 @@ module Reline
|
|
35
35
|
def reset_color_sequence
|
36
36
|
self.class::RESET_COLOR
|
37
37
|
end
|
38
|
+
|
39
|
+
# Read a single encoding valid character from the input.
|
40
|
+
def read_single_char(keyseq_timeout)
|
41
|
+
buffer = String.new(encoding: Encoding::ASCII_8BIT)
|
42
|
+
loop do
|
43
|
+
timeout = buffer.empty? ? Float::INFINITY : keyseq_timeout
|
44
|
+
c = getc(timeout)
|
45
|
+
return unless c
|
46
|
+
|
47
|
+
buffer << c
|
48
|
+
encoded = buffer.dup.force_encoding(encoding)
|
49
|
+
return encoded if encoded.valid_encoding?
|
50
|
+
end
|
51
|
+
end
|
38
52
|
end
|
39
53
|
end
|
40
54
|
|
@@ -1,12 +1,18 @@
|
|
1
1
|
class Reline::KeyActor::Base
|
2
|
-
def initialize(
|
3
|
-
@mapping = mapping
|
2
|
+
def initialize(mappings = nil)
|
4
3
|
@matching_bytes = {}
|
5
4
|
@key_bindings = {}
|
5
|
+
add_mappings(mappings) if mappings
|
6
6
|
end
|
7
7
|
|
8
|
-
def
|
9
|
-
|
8
|
+
def add_mappings(mappings)
|
9
|
+
add([27], :ed_ignore)
|
10
|
+
128.times do |key|
|
11
|
+
func = mappings[key]
|
12
|
+
meta_func = mappings[key | 0b10000000]
|
13
|
+
add([key], func) if func
|
14
|
+
add([27, key], meta_func) if meta_func
|
15
|
+
end
|
10
16
|
end
|
11
17
|
|
12
18
|
def add(key, func)
|
@@ -15,7 +15,7 @@ module Reline::KeyActor
|
|
15
15
|
# 6 ^F
|
16
16
|
:ed_next_char,
|
17
17
|
# 7 ^G
|
18
|
-
|
18
|
+
nil,
|
19
19
|
# 8 ^H
|
20
20
|
:em_delete_prev_char,
|
21
21
|
# 9 ^I
|
@@ -49,19 +49,19 @@ module Reline::KeyActor
|
|
49
49
|
# 23 ^W
|
50
50
|
:em_kill_region,
|
51
51
|
# 24 ^X
|
52
|
-
|
52
|
+
nil,
|
53
53
|
# 25 ^Y
|
54
54
|
:em_yank,
|
55
55
|
# 26 ^Z
|
56
56
|
:ed_ignore,
|
57
57
|
# 27 ^[
|
58
|
-
|
58
|
+
nil,
|
59
59
|
# 28 ^\
|
60
60
|
:ed_ignore,
|
61
61
|
# 29 ^]
|
62
62
|
:ed_ignore,
|
63
63
|
# 30 ^^
|
64
|
-
|
64
|
+
nil,
|
65
65
|
# 31 ^_
|
66
66
|
:undo,
|
67
67
|
# 32 SPACE
|
@@ -257,101 +257,101 @@ module Reline::KeyActor
|
|
257
257
|
# 127 ^?
|
258
258
|
:em_delete_prev_char,
|
259
259
|
# 128 M-^@
|
260
|
-
|
260
|
+
nil,
|
261
261
|
# 129 M-^A
|
262
|
-
|
262
|
+
nil,
|
263
263
|
# 130 M-^B
|
264
|
-
|
264
|
+
nil,
|
265
265
|
# 131 M-^C
|
266
|
-
|
266
|
+
nil,
|
267
267
|
# 132 M-^D
|
268
|
-
|
268
|
+
nil,
|
269
269
|
# 133 M-^E
|
270
|
-
|
270
|
+
nil,
|
271
271
|
# 134 M-^F
|
272
|
-
|
272
|
+
nil,
|
273
273
|
# 135 M-^G
|
274
|
-
|
274
|
+
nil,
|
275
275
|
# 136 M-^H
|
276
276
|
:ed_delete_prev_word,
|
277
277
|
# 137 M-^I
|
278
|
-
|
278
|
+
nil,
|
279
279
|
# 138 M-^J
|
280
280
|
:key_newline,
|
281
281
|
# 139 M-^K
|
282
|
-
|
282
|
+
nil,
|
283
283
|
# 140 M-^L
|
284
284
|
:ed_clear_screen,
|
285
285
|
# 141 M-^M
|
286
286
|
:key_newline,
|
287
287
|
# 142 M-^N
|
288
|
-
|
288
|
+
nil,
|
289
289
|
# 143 M-^O
|
290
|
-
|
290
|
+
nil,
|
291
291
|
# 144 M-^P
|
292
|
-
|
292
|
+
nil,
|
293
293
|
# 145 M-^Q
|
294
|
-
|
294
|
+
nil,
|
295
295
|
# 146 M-^R
|
296
|
-
|
296
|
+
nil,
|
297
297
|
# 147 M-^S
|
298
|
-
|
298
|
+
nil,
|
299
299
|
# 148 M-^T
|
300
|
-
|
300
|
+
nil,
|
301
301
|
# 149 M-^U
|
302
|
-
|
302
|
+
nil,
|
303
303
|
# 150 M-^V
|
304
|
-
|
304
|
+
nil,
|
305
305
|
# 151 M-^W
|
306
|
-
|
306
|
+
nil,
|
307
307
|
# 152 M-^X
|
308
|
-
|
308
|
+
nil,
|
309
309
|
# 153 M-^Y
|
310
310
|
:em_yank_pop,
|
311
311
|
# 154 M-^Z
|
312
|
-
|
312
|
+
nil,
|
313
313
|
# 155 M-^[
|
314
|
-
|
314
|
+
nil,
|
315
315
|
# 156 M-^\
|
316
|
-
|
316
|
+
nil,
|
317
317
|
# 157 M-^]
|
318
|
-
|
318
|
+
nil,
|
319
319
|
# 158 M-^^
|
320
|
-
|
320
|
+
nil,
|
321
321
|
# 159 M-^_
|
322
322
|
:redo,
|
323
323
|
# 160 M-SPACE
|
324
324
|
:em_set_mark,
|
325
325
|
# 161 M-!
|
326
|
-
|
326
|
+
nil,
|
327
327
|
# 162 M-"
|
328
|
-
|
328
|
+
nil,
|
329
329
|
# 163 M-#
|
330
|
-
|
330
|
+
nil,
|
331
331
|
# 164 M-$
|
332
|
-
|
332
|
+
nil,
|
333
333
|
# 165 M-%
|
334
|
-
|
334
|
+
nil,
|
335
335
|
# 166 M-&
|
336
|
-
|
336
|
+
nil,
|
337
337
|
# 167 M-'
|
338
|
-
|
338
|
+
nil,
|
339
339
|
# 168 M-(
|
340
|
-
|
340
|
+
nil,
|
341
341
|
# 169 M-)
|
342
|
-
|
342
|
+
nil,
|
343
343
|
# 170 M-*
|
344
|
-
|
344
|
+
nil,
|
345
345
|
# 171 M-+
|
346
|
-
|
346
|
+
nil,
|
347
347
|
# 172 M-,
|
348
|
-
|
348
|
+
nil,
|
349
349
|
# 173 M--
|
350
|
-
|
350
|
+
nil,
|
351
351
|
# 174 M-.
|
352
|
-
|
352
|
+
nil,
|
353
353
|
# 175 M-/
|
354
|
-
|
354
|
+
nil,
|
355
355
|
# 176 M-0
|
356
356
|
:ed_argument_digit,
|
357
357
|
# 177 M-1
|
@@ -373,21 +373,21 @@ module Reline::KeyActor
|
|
373
373
|
# 185 M-9
|
374
374
|
:ed_argument_digit,
|
375
375
|
# 186 M-:
|
376
|
-
|
376
|
+
nil,
|
377
377
|
# 187 M-;
|
378
|
-
|
378
|
+
nil,
|
379
379
|
# 188 M-<
|
380
|
-
|
380
|
+
nil,
|
381
381
|
# 189 M-=
|
382
|
-
|
382
|
+
nil,
|
383
383
|
# 190 M->
|
384
|
-
|
384
|
+
nil,
|
385
385
|
# 191 M-?
|
386
|
-
|
386
|
+
nil,
|
387
387
|
# 192 M-@
|
388
|
-
|
388
|
+
nil,
|
389
389
|
# 193 M-A
|
390
|
-
|
390
|
+
nil,
|
391
391
|
# 194 M-B
|
392
392
|
:ed_prev_word,
|
393
393
|
# 195 M-C
|
@@ -395,63 +395,63 @@ module Reline::KeyActor
|
|
395
395
|
# 196 M-D
|
396
396
|
:em_delete_next_word,
|
397
397
|
# 197 M-E
|
398
|
-
|
398
|
+
nil,
|
399
399
|
# 198 M-F
|
400
400
|
:em_next_word,
|
401
401
|
# 199 M-G
|
402
|
-
|
402
|
+
nil,
|
403
403
|
# 200 M-H
|
404
|
-
|
404
|
+
nil,
|
405
405
|
# 201 M-I
|
406
|
-
|
406
|
+
nil,
|
407
407
|
# 202 M-J
|
408
|
-
|
408
|
+
nil,
|
409
409
|
# 203 M-K
|
410
|
-
|
410
|
+
nil,
|
411
411
|
# 204 M-L
|
412
412
|
:em_lower_case,
|
413
413
|
# 205 M-M
|
414
|
-
|
414
|
+
nil,
|
415
415
|
# 206 M-N
|
416
416
|
:vi_search_next,
|
417
417
|
# 207 M-O
|
418
|
-
|
418
|
+
nil,
|
419
419
|
# 208 M-P
|
420
420
|
:vi_search_prev,
|
421
421
|
# 209 M-Q
|
422
|
-
|
422
|
+
nil,
|
423
423
|
# 210 M-R
|
424
|
-
|
424
|
+
nil,
|
425
425
|
# 211 M-S
|
426
|
-
|
426
|
+
nil,
|
427
427
|
# 212 M-T
|
428
|
-
|
428
|
+
nil,
|
429
429
|
# 213 M-U
|
430
430
|
:em_upper_case,
|
431
431
|
# 214 M-V
|
432
|
-
|
432
|
+
nil,
|
433
433
|
# 215 M-W
|
434
|
-
|
434
|
+
nil,
|
435
435
|
# 216 M-X
|
436
|
-
|
436
|
+
nil,
|
437
437
|
# 217 M-Y
|
438
438
|
:em_yank_pop,
|
439
439
|
# 218 M-Z
|
440
|
-
|
440
|
+
nil,
|
441
441
|
# 219 M-[
|
442
|
-
|
442
|
+
nil,
|
443
443
|
# 220 M-\
|
444
|
-
|
444
|
+
nil,
|
445
445
|
# 221 M-]
|
446
|
-
|
446
|
+
nil,
|
447
447
|
# 222 M-^
|
448
|
-
|
448
|
+
nil,
|
449
449
|
# 223 M-_
|
450
|
-
|
450
|
+
nil,
|
451
451
|
# 224 M-`
|
452
|
-
|
452
|
+
nil,
|
453
453
|
# 225 M-a
|
454
|
-
|
454
|
+
nil,
|
455
455
|
# 226 M-b
|
456
456
|
:ed_prev_word,
|
457
457
|
# 227 M-c
|
@@ -459,57 +459,57 @@ module Reline::KeyActor
|
|
459
459
|
# 228 M-d
|
460
460
|
:em_delete_next_word,
|
461
461
|
# 229 M-e
|
462
|
-
|
462
|
+
nil,
|
463
463
|
# 230 M-f
|
464
464
|
:em_next_word,
|
465
465
|
# 231 M-g
|
466
|
-
|
466
|
+
nil,
|
467
467
|
# 232 M-h
|
468
|
-
|
468
|
+
nil,
|
469
469
|
# 233 M-i
|
470
|
-
|
470
|
+
nil,
|
471
471
|
# 234 M-j
|
472
|
-
|
472
|
+
nil,
|
473
473
|
# 235 M-k
|
474
|
-
|
474
|
+
nil,
|
475
475
|
# 236 M-l
|
476
476
|
:em_lower_case,
|
477
477
|
# 237 M-m
|
478
|
-
|
478
|
+
nil,
|
479
479
|
# 238 M-n
|
480
480
|
:vi_search_next,
|
481
481
|
# 239 M-o
|
482
|
-
|
482
|
+
nil,
|
483
483
|
# 240 M-p
|
484
484
|
:vi_search_prev,
|
485
485
|
# 241 M-q
|
486
|
-
|
486
|
+
nil,
|
487
487
|
# 242 M-r
|
488
|
-
|
488
|
+
nil,
|
489
489
|
# 243 M-s
|
490
|
-
|
490
|
+
nil,
|
491
491
|
# 244 M-t
|
492
492
|
:ed_transpose_words,
|
493
493
|
# 245 M-u
|
494
494
|
:em_upper_case,
|
495
495
|
# 246 M-v
|
496
|
-
|
496
|
+
nil,
|
497
497
|
# 247 M-w
|
498
|
-
|
498
|
+
nil,
|
499
499
|
# 248 M-x
|
500
|
-
|
500
|
+
nil,
|
501
501
|
# 249 M-y
|
502
|
-
|
502
|
+
nil,
|
503
503
|
# 250 M-z
|
504
|
-
|
504
|
+
nil,
|
505
505
|
# 251 M-{
|
506
|
-
|
506
|
+
nil,
|
507
507
|
# 252 M-|
|
508
|
-
|
508
|
+
nil,
|
509
509
|
# 253 M-}
|
510
|
-
|
510
|
+
nil,
|
511
511
|
# 254 M-~
|
512
|
-
|
512
|
+
nil,
|
513
513
|
# 255 M-^?
|
514
514
|
:ed_delete_prev_word
|
515
515
|
# EOF
|