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

QR Code problem under screen/xterm #1455

Closed
suntong opened this Issue Jul 10, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@suntong
Copy link
Contributor

suntong commented Jul 10, 2018

screen is the famous VT100/ANSI terminal emulation under *nix, that allows people to run terminal session on the server, after log off, or even after dis-connect.

However, I found that QR Code is not output correctly under screen.

So under the same terminal, and anything else are the same, within & outside screen will cause wechaty to print QR Code differently.

In both case, I have:

DISPLAY='localhost:10.0'
LANG='C'

The only difference is within & outside screen (TERM='screen' or TERM='rxvt-unicode-256color').

Ah~, found my local xterm (TERM='xterm') is having the same problem as well. The QR Code is output as:

â
 â
  â
   â
    â
     â
      â
       â
        â
         â
          â
           â
            â
             â
              â
               â
                â
                 â
                  â
                   â
                    â
                     â
                      â
                       â
                        â
                         â
                          â
                           â
                            â
                             â
                              â

â â
   â
    â
     â
      â
        ââ
          â â  ââ âââ
                     â
                      â â
                         â
                          â
                           â
                            â
                              â
â â   â â   âââ
                 ââ â
                     ââ â   â â
â ââ
    â
     â
      â ââ
          ââ â
              âââ ââ ââ ââ
                          â
                           â
                            â â
ââ
  â
   â
    â
     â
      â
       â
        ââ
          â â ââ
                ââ
                  ââ
                    ââ
                      ââ
                        â
                         â
                          â
                           â
                            â
                             â
                              â
ââ
    â
     âââ
        â â â
               â
                â â
                    ââ ââ â
                           â
                            â â
â ââ
    ââââ
         â  â
             â
               ââââââ â
                       â
                        ââââ
                            â
                             ââ
ââââââââ
        ââ â
            â â
               â
                âââ
                   â ââ
                       ââââ
                            âââ
ââ
   â
    â  â
        ââââ
             ââ â â
                   â
                    â
                     â
                       â  ââ
                             â
                              â
ââ â â â
        â
         ââ
            ââ
              â
                 âââ
                    â
                       â â
                           â ââ
ââ
  â ââââ
        â
         â
          ââââââ
                â
                  âââââââ
                         ââ âââ
âââ
   â
    ââ
      ââ
        â
         âââ
            âââââ  ââ â
                       â
                        â
                            âââ
â â
   â
    â
     â
      â
        âââ
           â
            ââââââ
                  â â
                      ââ
                        â  ââ
                             ââ
â â   â ââââ âââ  â
                   ââ  â
                          ââ
                            â
                              â
â ââ
    â
     â
      â â  ââ ââ
                âââ â
                      âââ
                         âââ
                            ââ
                              â
ââ
  â
   â
    â
     â
      â
       â
        ââ
          â
           ââ
             ââââ
                 ââââ
                     â
                      â
                       âââ
                          âââ
                             ââ
@huan

This comment has been minimized.

Copy link
Member

huan commented Jul 10, 2018

  1. This issue should be posted at https://github.com/gtanner/qrcode-terminal instead here
  2. A workaround should be using a QR code web generator to give you an image.

See:

function onScan (qrcode: string, status: number) {
generate(qrcode, { small: true })
// Generate a QR Code online via
// http://goqr.me/api/doc/create-qr-code/
const qrcodeImageUrl = [
'https://api.qrserver.com/v1/create-qr-code/?data=',
encodeURIComponent(qrcode),
].join('')
console.log(`[${status}] ${qrcodeImageUrl}\nScan QR Code above to log in: `)

@suntong

This comment has been minimized.

Copy link
Contributor

suntong commented Jul 10, 2018

@huan

This comment has been minimized.

Copy link
Member

huan commented Jul 11, 2018

Great!

So could we close this issue for now?

@suntong

This comment has been minimized.

Copy link
Contributor

suntong commented Jul 11, 2018

sure.

@suntong suntong closed this Jul 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment