Giter Site home page Giter Site logo

Comments (6)

xiaq avatar xiaq commented on August 27, 2024

This is weird. I will try to reproduce this on Ubuntu 12.04.

from elvish.

xiaq avatar xiaq commented on August 27, 2024

I tried building elvish on Ubuntu 12.04 with go 1.4.1 and could not reproduce the issue. Could you try again with the latest commit? If there is still a problem, please provide me the version of the go toolchain as well as the terminal you are using; it looks like a terminal-related problem.

from elvish.

glycerine avatar glycerine commented on August 27, 2024

still there, crashing at writer.go:216

go1.3.3
ubuntu12.04/amd64
terminal: I run (gnu) screen, then inside screen I run "emacs -nw", then I start a shell with "M-x shell"
It does seem to be related to running inside emacs. If I start elvish just inside screen, it starts up without problem.

:~$ elvish
panic: runtime error: invalid memory address or nil pointer dereference
    panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x4d4b5c]

goroutine 16 [running]:
runtime.panic(0x5cb700, 0x8cd613)
    /home/jaten/pkg/go/src/pkg/runtime/panic.c:279 +0xf5
github.com/elves/elvish/edit.(*writer).commitBuffer(0xc2080003e0, 0x0, 0x0, 0x0)
    /home/jaten/go/src/github.com/elves/elvish/edit/writer.go:216 +0x6c
github.com/elves/elvish/edit.(*writer).refresh(0xc2080003e0, 0xc208096040, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/jaten/go/src/github.com/elves/elvish/edit/writer.go:538 +0x1cd4
github.com/elves/elvish/edit.(*Editor).refresh(0xc208096000, 0x0, 0x0)
    /home/jaten/go/src/github.com/elves/elvish/edit/editor.go:121 +0x21b
github.com/elves/elvish/edit.(*Editor).finishReadLine(0xc208096000, 0xc2080247b0)
    /home/jaten/go/src/github.com/elves/elvish/edit/editor.go:298 +0x1bd
runtime.panic(0x5cb700, 0x8cd613)
    /home/jaten/pkg/go/src/pkg/runtime/panic.c:248 +0x18d
github.com/elves/elvish/edit.(*writer).commitBuffer(0xc2080003e0, 0x0, 0x0, 0x0)
    /home/jaten/go/src/github.com/elves/elvish/edit/writer.go:216 +0x6c
github.com/elves/elvish/edit.(*writer).refresh(0xc2080003e0, 0xc208096040, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/jaten/go/src/github.com/elves/elvish/edit/writer.go:538 +0x1cd4
github.com/elves/elvish/edit.(*Editor).refresh(0xc208096000, 0x0, 0x0)
    /home/jaten/go/src/github.com/elves/elvish/edit/editor.go:121 +0x21b
github.com/elves/elvish/edit.(*Editor).ReadLine(0xc208096000, 0x631250, 0x7f5207c97e10, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/jaten/go/src/github.com/elves/elvish/edit/editor.go:328 +0x1e1
main.interact()
    /home/jaten/go/src/github.com/elves/elvish/main.go:66 +0x389
main.main()
    /home/jaten/go/src/github.com/elves/elvish/main.go:133 +0x2c

from elvish.

xiaq avatar xiaq commented on August 27, 2024

Thanks. Now I can reproduce that. I'll look into it some time.

The editor part of Elvish makes quite some assumptions about the terminal so it's no surprise that it panics when run in an exotic terminal. It should be programmed more defensively though.

from elvish.

xiaq avatar xiaq commented on August 27, 2024

The Emacs pseudo-tty has really limited capability. For one thing, it does not implement the TIOCGWINSZ ioctl call properly, which is used is query the window size. Instead of the actual window size it always indicates a width of 0 and a height of 0.

I fixed the code so that it will now no longer panic. But Elvish still will not function properly (e.g. you will see some garbage characters) since the line editor relies on the availability of the more advanced terminal capabilities. Actually the line editor of Elvish in its currently form is essentially a full-screen application comparable to Vim.

I might add some "fallback mode" to the line editor at some time in future.

from elvish.

xiaq avatar xiaq commented on August 27, 2024

For further discussion, see #41.

from elvish.

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.