GithubHelp home page GithubHelp logo

Comments (3)

rjkroege avatar rjkroege commented on June 25, 2024

The difference would appear to be in client.go:/func.*Start

2023/08/02 05:16:48 CPU:start
2023/08/02 05:16:48 CPU:client:c.session.RequestPty("ansi", 87, 157, map[0x35:0x0 0x80:0x3840 0x81:0x3840]
2023/08/02 05:16:48 CPU:client:call session.Start(-port9p=45715 'echo' 'hello')

When executed from a terminal, the cpu client has a pty. So this block is the underlying cause of the presence of the \r.

	if c.hasTTY {
		verbose("c.session.RequestPty(\"ansi\", %v, %v, %#x", c.Row, c.Col, modes)
		if err := c.session.RequestPty("ansi", c.Row, c.Col, modes); err != nil {
			return fmt.Errorf("request for pseudo terminal failed: %v", err)
		}
	}

Hypothesis: modes needs adjustment?

from cpu.

rjkroege avatar rjkroege commented on June 25, 2024

Aside: why does:

func verbose(f string, a ...interface{}) {
	v("CPU:"+f+"\r\n", a...)
}

append a \r to every log message?

from cpu.

rjkroege avatar rjkroege commented on June 25, 2024

I hypothesize that this happens because of how gliderlabs/ssh forces the insertion of \r\n when the ssh client requested a pty. I think gliderlabs/ssh#210 (as is included in Tailscale's tailscale/tailscale#4154) would probably fix this issue.

Seems like cpu could use https://github.com/charmbracelet/ssh to fix this bug. I'll try this and update the bug.

from cpu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.