Terminal shows SOH and STX characters in Ruby's pry for some reason #14677

Open
opened 2026-01-31 04:16:40 +00:00 by claunia · 0 comments
Owner

Originally created by @OmriSama on GitHub (Jul 25, 2021).

Windows Terminal version (or Windows build number)

Terminal 1.8.1521.0, Windows 10.0.19043.0

Other Software

WSL2, running Manjaro Linux: https://github.com/sileshn/ManjaroWSL
Using Zsh and oh-my-zsh (but reproduced with Bash)
Fira Code Retina font (but run into this with other fonts)

ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux]
Pry version 0.14.1 on Ruby 3.0.2

Steps to reproduce

With everything installed properly (pry in $PATH):

➜  ~  pry
[1] pry(main)> ls Module

Expected Behavior

No special characters or control codes should be shown:

[1] pry(main)> ls Module
Module.methods: constants  nesting  used_modules
Module#methods:
  <              attr_writer              const_set              method_defined?             protected_method_defined?
  <=             autoload                 const_source_location  module_eval                 public_class_method
  <=>            autoload?                constants              module_exec                 public_constant
  ==             class_eval               define_method          name                        public_instance_method
  ===            class_exec               deprecate_constant     prepend                     public_instance_methods
  >              class_variable_defined?  freeze                 pretty_print                public_method_defined?
  >=             class_variable_get       include                pretty_print_cycle          remove_class_variable
  alias_method   class_variable_set       include?               private_class_method        remove_method
  ancestors      class_variables          included_modules       private_constant            singleton_class?
  attr           const_defined?           inspect                private_instance_methods    to_s
  attr_accessor  const_get                instance_method        private_method_defined?     undef_method
  attr_reader    const_missing            instance_methods       protected_instance_methods
[2] pry(main)>

Actual Behavior

For some reason, special characters/control codes are being shown:

image

[1] pry(main)> ls Module
Module.methods: constants  nesting  used_modules
Module#methods:
  <              attr_writer              const_set              method_defined?             protected_method_defined?
  <=             autoload                 const_source_location  module_eval                 public_class_method
  <=>            autoload?                constants              module_exec                 public_constant
  ==             class_eval               define_method          name                        public_instance_method
  ===            class_exec               deprecate_constant     prepend                     public_instance_methods
  >              class_variable_defined?  freeze                 pretty_print                public_method_defined?
  >=             class_variable_get       include                pretty_print_cycle          remove_class_variable
  alias_method   class_variable_set       include?               private_class_method        remove_method
  ancestors      class_variables          included_modules       private_constant            singleton_class?
  attr           const_defined?           inspect                private_instance_methods    to_s
  attr_accessor  const_get                instance_method        private_method_defined?     undef_method
  attr_reader    const_missing            instance_methods       protected_instance_methods
[2] pry(main)>
Originally created by @OmriSama on GitHub (Jul 25, 2021). ### Windows Terminal version (or Windows build number) Terminal 1.8.1521.0, Windows 10.0.19043.0 ### Other Software WSL2, running Manjaro Linux: https://github.com/sileshn/ManjaroWSL Using Zsh and oh-my-zsh (but reproduced with Bash) Fira Code Retina font (but run into this with other fonts) ``` ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux] ``` ``` Pry version 0.14.1 on Ruby 3.0.2 ``` ### Steps to reproduce With everything installed properly (`pry` in `$PATH`): ```sh ➜ ~ pry [1] pry(main)> ls Module ``` ### Expected Behavior No special characters or control codes should be shown: ```ruby [1] pry(main)> ls Module Module.methods: constants nesting used_modules Module#methods: < attr_writer const_set method_defined? protected_method_defined? <= autoload const_source_location module_eval public_class_method <=> autoload? constants module_exec public_constant == class_eval define_method name public_instance_method === class_exec deprecate_constant prepend public_instance_methods > class_variable_defined? freeze pretty_print public_method_defined? >= class_variable_get include pretty_print_cycle remove_class_variable alias_method class_variable_set include? private_class_method remove_method ancestors class_variables included_modules private_constant singleton_class? attr const_defined? inspect private_instance_methods to_s attr_accessor const_get instance_method private_method_defined? undef_method attr_reader const_missing instance_methods protected_instance_methods [2] pry(main)> ``` ### Actual Behavior For some reason, special characters/control codes are being shown: ![image](https://user-images.githubusercontent.com/10534779/126884330-f4cceb7d-39bf-463c-8488-52616d12ea02.png) ```ruby [1] pry(main)> ls Module Module.methods: constants nesting used_modules Module#methods: < attr_writer const_set method_defined? protected_method_defined? <= autoload const_source_location module_eval public_class_method <=> autoload? constants module_exec public_constant == class_eval define_method name public_instance_method === class_exec deprecate_constant prepend public_instance_methods > class_variable_defined? freeze pretty_print public_method_defined? >= class_variable_get include pretty_print_cycle remove_class_variable alias_method class_variable_set include? private_class_method remove_method ancestors class_variables included_modules private_constant singleton_class? attr const_defined? inspect private_instance_methods to_s attr_accessor const_get instance_method private_method_defined? undef_method attr_reader const_missing instance_methods protected_instance_methods [2] pry(main)> ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#14677