# Is there a way to show preview images in the terminal in the same way the Drracket IDE does?

**URL:** <https://racket.discourse.group/t/is-there-a-way-to-show-preview-images-in-the-terminal-in-the-same-way-the-drracket-ide-does/2588>\
**Category:** Questions & Answers\
**Tags:** question\
**Created:** [December 10, 2023, 1:54pm UTC](https://racket.discourse.group/t/is-there-a-way-to-show-preview-images-in-the-terminal-in-the-same-way-the-drracket-ide-does/2588 "2023-12-10T13:54:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Catoflado](https://avatars.discourse-cdn.com/v4/letter/c/41988e/32.png) [@Catoflado](https://racket.discourse.group/u/Catoflado)\
**Post date:** [December 10, 2023, 1:54pm UTC](https://racket.discourse.group/t/is-there-a-way-to-show-preview-images-in-the-terminal-in-the-same-way-the-drracket-ide-does/2588/1 "2023-12-10T13:54:44Z")

</div>

For exemple, if I write:  
#lang racket  
(require 2htdp/image)

(circle 20 "solid" "blue")

In Drracket, it will preview a bitmap circle in the REPL.  
But using the terminal (with Neovim texteditor) it shows:

(object:image% ... ...)

I really like using neovim and vim motions, so I'd like to have this kind of feature on the terminal.

 ![Captura de tela de 2023-12-10 10-28-40](https://global.discourse-cdn.com/free1/uploads/racket/original/2X/b/be20409349d57b07b2398c0d87aed17feeee11d6.png)

---

<div class="post-metadata">

**Author:** ![benknoble](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/benknoble/32/16_2.png) [@benknoble](https://racket.discourse.group/u/benknoble)\
**Post date:** [December 10, 2023, 3:32pm UTC](https://racket.discourse.group/t/is-there-a-way-to-show-preview-images-in-the-terminal-in-the-same-way-the-drracket-ide-does/2588/2 "2023-12-10T15:32:37Z")

</div>

In a terminal, you need to set the print handler to show images in a GUI. One such version is

```scheme
(define (make-pict-print-handler)
(dynamic-require 'racket/gui #f) ;; or show-pict might not work
(define old-handler (current-print))
(define (new-handler v)
(old-handler
(if (pict? v) (show-pict v) v)))
new-handler)

(current-print (make-pict-print-handler))

```

This is for picts but could probably be easily adjusted for 2hdtp/image.
