Skip to content
Myr

Add 'bell' action to ring the terminal bell

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent 02199cd · Browse files · 8 files+22 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

8 files+22 added−0 removed

  • other:+22 added−0 removed

8 files+22 added−0 removed

modified:man/man1/fzf.1+1 added
1539 unmodified lines
1540 \fBbackward\-kill\-word\fR \fIalt\-bs\fR1541 \fBbackward\-word\fR \fIalt\-b shift\-left\fR1542 \fBbecome(...)\fR (replace fzf process with the specified command; see below for the details)1543 \fBbeginning\-of\-line\fR \fIctrl\-a home\fR1544 \fBbell\fR (ring the terminal bell)1545 \fBcancel\fR (clear query string if not empty, abort fzf otherwise)1546 \fBchange\-border\-label(...)\fR (change \fB\-\-border\-label\fR to the given string)1547 \fBchange\-header(...)\fR (change header to the given string; doesn't affect \fB\-\-header\-lines\fR)1548 \fBchange\-header\-label(...)\fR (change \fB\-\-header\-label\fR to the given string)
272 unmodified lines
modified:src/tui/dummy.go+1 added
42 unmodified lines
43func (r *FullscreenRenderer) PassThrough(string) {}44func (r *FullscreenRenderer) Clear() {}45func (r *FullscreenRenderer) NeedScrollbarRedraw() bool { return false }46func (r *FullscreenRenderer) ShouldEmitResizeEvent() bool { return false }47func (r *FullscreenRenderer) Bell() {}48func (r *FullscreenRenderer) Refresh() {}49func (r *FullscreenRenderer) Close() {}50func (r *FullscreenRenderer) Size() TermSize { return TermSize{} }51
10 unmodified lines
modified:src/tui/light.go+4 added
30 unmodified lines
3132var offsetRegexp = regexp.MustCompile("(.*)\x1b\\[([0-9]+);([0-9]+)R")33var offsetRegexpBegin = regexp.MustCompile("^\x1b\\[[0-9]+;[0-9]+R")3435func (r *LightRenderer) Bell() {36 r.flushRaw("\a")37}3839func (r *LightRenderer) PassThrough(str string) {40 r.queued.WriteString("\x1b7" + str + "\x1b8")41}42
1176 unmodified lines
modified:src/tui/tcell.go+4 added
98 unmodified lines
99 AttrClear = Attr(1 << 8)100 BoldForce = Attr(1 << 10)101)102103func (r *FullscreenRenderer) Bell() {104 _screen.Beep()105}106107func (r *FullscreenRenderer) PassThrough(str string) {108 // No-op109 // https://github.com/gdamore/tcell/pull/650#issuecomment-1806442846110}
763 unmodified lines
modified:src/tui/tui.go+1 added
578 unmodified lines
579 Close()580 PassThrough(string)581 NeedScrollbarRedraw() bool582 ShouldEmitResizeEvent() bool583 Bell()584585 GetChar() Event586587 Top() int
449 unmodified lines
modified:src/options.go+2 added
1584 unmodified lines
1585 appendAction(actChar)1586 } else {1587 return nil, errors.New("unable to put non-printable character")1588 }1589 case "bell":1590 appendAction(actBell)1591 default:1592 t := isExecuteAction(specLower)1593 if t == actIgnore {1594 if specIndex == 0 && specLower == "" {
1701 unmodified lines
modified:src/terminal.go+3 added
565 unmodified lines
566 actRebind567 actBecome568 actShowHeader569 actHideHeader570 actBell571)572573func (a actionType) Name() string {574 return util.ToKebabCase(a.String()[3:])
4129 unmodified lines
4704 } else {4705 t.executor.Become(t.ttyin, t.environ(), command)4706 }4707 }4708 case actBell:4709 t.tui.Bell()4710 case actExecute, actExecuteSilent:4711 t.executeCommand(a.a, false, a.t == actExecuteSilent, false, false, "")4712 case actExecuteMulti:4713 t.executeCommand(a.a, true, false, false, false, "")
1286 unmodified lines
modified:CHANGELOG.md+6 added
7 unmodified lines
8 - `--scheme=path` now sets `--tiebreak=pathname,length`9 - fzf will automatically choose `path` scheme when the input is a TTY device, where fzf would start its built-in walker or run `$FZF_DEFAULT_COMMAND` which is usually a command for listing files.10- Added `--header-lines-border` to display header from `--header-lines` with a separate border11 ```sh12 # Use --header-lines-border to separate two headers13 ps -ef | fzf --style full --layout reverse --header-lines 1 \14 --bind 'ctrl-r:reload(ps -ef)' --header 'Press CTRL-R to reload' \15 --header-lines-border bottom --no-list-border16 ```17- Added `bell` action to ring the terminal bell18 ```sh19 # Press CTRL-Y to copy the current line to the clipboard and ring the bell20 fzf --bind 'ctrl-y:execute-silent(echo -n {} | pbcopy)+bell'21 ```22- Bug fixes and improvements23- Fixed fish script to support fish 3.1.2 or later (@bitraid)24250.58.0
2430 unmodified lines