10

How to do a text search into a cygwin window buffer ? Is there a way to make the same kind of text seach as in Windows console buffer (right-click > search) ?

(I use mintty)

fjardon
  • 7,510
  • 19
  • 29
Philippe Blayo
  • 9,632
  • 14
  • 43
  • 62

5 Answers5

15

In mintty, you can do that using the sequence Alt+F3.

More information in the mintty man page

Searching in the text and scrollback buffer

Alt-F3 opens a search bar with an input field for a search string. Matches are highlighted in the scrollback buffer. Enter/Shift+Enter find the next/previous position of the match and scrolls the scrollback buffer accordingly. The appearance of the search bar and the matching highlight colours can be customized.

Beware this sequence is very close to the infamous windows sequence that closes a window. (which uses F4)

Alternatively, you can enable the Ctrl+Shift+H shortcut by going into the options pane of mintty and enabling Ctrl+Shift+letters shortcuts in the Key section of the options.

You access the options pane by right-clicking the mintty icon of the mintty window (upper left corner)

not2qubit
  • 10,014
  • 4
  • 72
  • 101
fjardon
  • 7,510
  • 19
  • 29
3

There's no such function currently. The closest alternative is to 'Select All' (followed by 'Copy' if you've disabled copy-on-select), paste into a text editor, and search there.

ak2
  • 6,262
  • 27
  • 23
0

You have a few options.

  1. Use cmd | tee file, then search in the resulting file afterwards.

  2. Use screen's copy/scrollback mode.

Yaakov
  • 1,655
  • 10
  • 10
0

(Mintty) I'd mucked up an rsync command (wrong direction) so I wanted to track which files had been altered. So I manually selected the Mintty screen output from the bottom with my mouse hold left mouse button and then push to top of the screen and then tediously waited while the screen scrolled forever backwards then when I'd gone back as far as I needed I did a Control-Insert to copy. I then pasted into a text file which I could then search, edit, grep, vim to my hearts content. Don't know if this the only way but it works!

zzapper
  • 4,003
  • 5
  • 44
  • 41
-1

I used emacs editor as buffer. From emacs open shell : C-x shell, then I can do search within buffer as current window.

hDo
  • 1