Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spacing issue in output #3

Open
leereilly opened this issue Aug 18, 2021 · 3 comments
Open

Spacing issue in output #3

leereilly opened this issue Aug 18, 2021 · 3 comments

Comments

@leereilly
Copy link

Noticed that marquee is offset here:

$ gh screensaver -l   
fireworks
         marquee

Similarly, when I pass in the incorrect flag i.e. -list instead of --list:

$ gh screensaver -list
Error: unknown shorthand flag: 'i' in -ist
                                          Usage:
                                                  screensaver [flags]

                                                                     Flags:
                                                                             -h, --help           help for screensaver
                                                                                                                        -l, --list           List available screensavers and exit
   -R, --repo string    Repository to contribute to
                                                     -s, --saver string   Screensaver to play

                                                                                             unknown shorthand flag: 'i' in -ist

Possibly related to the error log output in #2.

@leereilly
Copy link
Author

So this behavior is now gone. Is it possible some gh / gh extension script altered something in my shell session? 🤔

@leereilly
Copy link
Author

Aaaand it's back. How to recreate with gh 1.14.0-62-g8a563599 and this extension as of 4ab7694:

  1. Navigate to a repo
  2. Type gh and see the output nicely formatted
  3. Type gh screensaver -s foo and you'll see an error message
  4. Type gh (or any other command) and you'll see the weird spacing issue

$ cd github/cli 

$ gh 
Work seamlessly with GitHub from the command line.

USAGE
  gh <command> <subcommand> [flags]

CORE COMMANDS
  browse:     Open the repository in the browser
  gist:       Manage gists
  issue:      Manage issues
  pr:         Manage pull requests
  release:    Manage GitHub releases
  repo:       Create, clone, fork, and view repositories

ACTIONS COMMANDS
  actions:    Learn about working with GitHub actions
  run:        View details about workflow runs
  workflow:   View details about GitHub Actions workflows

ADDITIONAL COMMANDS
  alias:      Create command shortcuts
  api:        Make an authenticated GitHub API request
  auth:       Login, logout, and refresh your authentication
  completion: Generate shell completion scripts
  config:     Manage configuration for gh
  help:       Help about any command
  secret:     Manage GitHub secrets
  ssh-key:    Manage SSH keys

EXTENSION COMMANDS
  branch
  contribute
  screensaver
  user-status

FLAGS
  --help      Show help for command
  --version   Show gh version

EXAMPLES
  $ gh issue create
  $ gh repo clone cli/cli
  $ gh pr checkout 321

ENVIRONMENT VARIABLES
  See 'gh help environment' for the list of supported environment variables.

LEARN MORE
  Use 'gh <command> <subcommand> --help' for more information about a command.
  Read the manual at https://cli.github.com/manual

FEEDBACK
  Open an issue using 'gh issue create -R github.com/cli/cli'

gh screensaver -s foo

panic: runtime error: invalid memory address or nil pointer dereference
                                                                       [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x11e3abd]

                                                                                                                                              goroutine 1 [running]:
                                                                                                                                                                    main.runScreensaver(0x7ffeefbffc1e, 0x3, 0xc000239006, 0x7, 0x0, 0x0, 0x0, 0x0, 0x12fae70, 0xc00021e240, ...)
                                                                                                        /Users/leereilly/.local/share/gh/extensions/gh-screensaver/main.go:31 +0x17d
    main.rootCmd.func1(0xc0001bef00, 0xc0001ac260, 0x0, 0x2, 0x0, 0x0)
                                                                        /Users/leereilly/.local/share/gh/extensions/gh-screensaver/main.go:121 +0x298
                                                                                                                                                     github.com/spf13/cobra.(*Command).execute(0xc0001bef00, 0xc000182190, 0x2, 0x2, 0xc0001bef00, 0xc000182190)
                                                                                        /Users/leereilly/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:856 +0x472
                                                                                                                                                                       github.com/spf13/cobra.(*Command).ExecuteC(0xc0001bef00, 0xc000000300, 0x200000003, 0xc000000300)
                                                                                                /Users/leereilly/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:974 +0x375
                                                                                                                                                                               github.com/spf13/cobra.(*Command).Execute(...)
                                                /Users/leereilly/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:902
                                                                                                                        main.main()
                                                                                                                                        /Users/leereilly/.local/share/gh/extensions/gh-screensaver/main.go:151 +0x2b

$ gh

         contribute
                     screensaver
                                  user-status

                                             FLAGS
                                                    --help      Show help for command
                                                                                       --version   Show gh version

                                                                                                                  EXAMPLES
                                                                                                                            $ gh issue create
                                                                                                                                               $ gh repo clone cli/cli
                                                                                                                                                                        $ gh pr checkout 321

            ENVIRONMENT VARIABLES
                                   See 'gh help environment' for the list of supported environment variables.

                                                                                                             LEARN MORE
                                                                                                                         Use 'gh <command> <subcommand> --help' for more information about a command.
                       Read the manual at https://cli.github.com/manual

                                                                       FEEDBACK
                                                                                 Open an issue using 'gh issue create -R github.com/cli/cli'

@leereilly leereilly reopened this Aug 18, 2021
@vilmibm
Copy link
Owner

vilmibm commented Sep 23, 2021

i think this is fallout from what tcell does to the terminal and I don't know that i can fix it; I can at least minimize the number of panics :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants