Comments (6)
This is weird. I will try to reproduce this on Ubuntu 12.04.
from elvish.
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.
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.
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.
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.
For further discussion, see #41.
from elvish.
Related Issues (20)
- Unique symbols HOT 1
- Disable flow control by default HOT 1
- vscode-neovim doesn't work with Elvish as default shell HOT 15
- Race condition when starting multiple instances simultaneously HOT 2
- RSS support for the blog
- Support semantic prompts (OSC 133) HOT 1
- Directory Elvish is launched from doesn't seem to be added to location history HOT 10
- Docs for embedding Elvish? HOT 6
- RISC-V binaries HOT 5
- "Command not found" error when running a batch script with space in path with an argument with space HOT 16
- API to change the in-command colours? HOT 3
- Cursor and prompt control in function to avoid prompt flick HOT 10
- document and change behavior of `doc:find` with no arguments
- Indexing into a list of maps HOT 2
- listbox_window: integer divide by zero HOT 6
- Add `&key` option to `compact`.
- Are there any good examples for custom completion script? HOT 2
- Add helpful message for arity mismatch on function call
- Minibuffer namespace
- COMPLETING argument menu shown even when only one completion on paths that start ~/ HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elvish.