junegunn / junegunn/fzf

Ctrl-R deletes last ouput line under gnu screen when PS1 contains \u@\h

Open
#2,117 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
83k
Forks
2.9k
Avg merge
17h 8m
Merged PRs (30d)
10

Description

- [x] I have read through the manual page (`man fzf`)
- [x] I have the latest version of fzf
- [x] I have searched through the existing issues

## Info

- OS
- [x] Linux
- [ ] Mac OS X
- [ ] Windows
- [ ] Etc.
- Shell
- [x] bash
- [ ] zsh
- [ ] fish

## Problem / Steps to reproduce

When running under gnu screen, if PS1 contains \u@\h, Ctrl-R history selection deletes last output line.

To reproduce:

export PS1='\u@\h'
pwd
Ctrl-R -> select pwd, last output of pwd will be deleted

Workaround (enclose \h with \[\]):

export PS1='\[\u\]@\h'

This might not be a problem of fzf at all --- running under tmux has no problem.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the Ctrl-R history selection under GNU screen with bash and PS1 set to '\u@\h', then compare the same steps under tmux and with the documented workaround. Trace whether the deleted output is caused by fzf or terminal interaction; done means selecting history no longer removes the last output line under the reported setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, go
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.