mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-01 00:33:05 +08:00
Fix the doc for ttyshots.
- Wrap the command in "print" to get byte output. - Use global-binding to ensure that the key works in all modes.
This commit is contained in:
parent
1d36d299b8
commit
1ec9c95142
|
@ -27,8 +27,7 @@ import (
|
|||
// Example:
|
||||
//
|
||||
// ```elvish
|
||||
// ttyshot = ~/a.html
|
||||
// edit:insert:binding[Ctrl-X] = { edit:-dump-buf > $tty }
|
||||
// edit:global-binding[Ctrl-X] = { edit:-dump-buf > ~/a.html }
|
||||
// ```
|
||||
|
||||
func dumpBuf(tty cli.TTY) string {
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
This directory contains "ttyshots" -- they are like screenshots, but taken on
|
||||
terminals. They are taken with Elvish's undocumented `edit:-dump-buf` function.
|
||||
To take one, use the following procedure:
|
||||
terminals. They are taken with Elvish's `edit:-dump-buf` function. To take one,
|
||||
use the following procedure:
|
||||
|
||||
1. Modify `edit:rprompt` to pretend that the username is `elf` and the hostname
|
||||
is `host`:
|
||||
|
||||
```elvish
|
||||
edit:rprompt = (constantly (styled 'elf@host' inverse))
|
||||
set edit:rprompt = (constantly (styled 'elf@host' inverse))
|
||||
```
|
||||
|
||||
2. Add a keybinding for taking ttyshots:
|
||||
|
||||
```elvish
|
||||
edit:insert:binding[Alt-x] = { edit:-dump-buf > ~/ttyshot.html }
|
||||
edit:global-binding[Alt-x] = { print (edit:-dump-buf) > ~/ttyshot.html }
|
||||
```
|
||||
|
||||
3. Make sure that the terminal width is 58, to be consistent with existing
|
||||
|
|
Loading…
Reference in New Issue
Block a user