Skip to content

GetPortsList causes the existing serial console on Linux to become unresponsive. #210

@iLiQi

Description

@iLiQi

Describe the problem

Even if I close PuTTY and reopen it, the problem cannot be resolved. I can only perform a reboot.

To reproduce

  1. Connect a Windows computer to a Linux server using a CH340 USB serial cable via PuTTY.
  2. Run this code
package main

import (
	"log"
	"go.bug.st/serial"
)

func main() {
	ports, err := serial.GetPortsList()
	log.Println("Available serial ports: ", ports)
	if err != nil {
		log.Fatal(err)
	}
}

  1. The opened PuTTY terminal cannot input or output.

Please double-check that you have reported each of the following

before submitting the issue.

  • I've provided the FULL source code that causes the problem
  • I've provided all the actions required to reproduce the problem

Expected behavior

when serial.GetPortsList is called, it should not affect the already open terminals.

Operating system and version

Centos 9

Please describe your hardware setup

normal x86

Additional context

No response

Issue checklist

  • I searched for previous requests in the issue tracker
  • My request contains all necessary details

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions