# Hands-on Rust: Chapter 3: Can't get first hello to run

**URL:** <https://forum.devtalk.com/t/hands-on-rust-chapter-3-cant-get-first-hello-to-run/97229>\
**Category:** PragProg Customers\
**Tags:** question, book-hands-on-rust\
**Created:** [18 February 2023 20:18 UTC](https://forum.devtalk.com/t/hands-on-rust-chapter-3-cant-get-first-hello-to-run/97229 "2023-02-18T20:18:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bjnord](https://forum.devtalk.com/user_avatar/forum.devtalk.com/bjnord/32/730_2.png) [@bjnord](https://forum.devtalk.com/u/bjnord)\
**Post date:** [18 February 2023 20:18 UTC](https://forum.devtalk.com/t/hands-on-rust-chapter-3-cant-get-first-hello-to-run/97229/1 "2023-02-18T20:18:43Z")

</div>

Hello @herbert ! Trying to get the very first “Hello, Bracket Terminal!" example to run (p. 53). I develop on an Amazon EC2 instance running Amazon Linux 2 (their customized version of RHEL 7) and Rust 1.67.1

I’m using the exact code from FirstGameFlappyAscii/hello\_bterm. If I compile and run that as-is, it blows up because I don’t have Wayland/X11/etc. on this box:

```
 Running `target/debug/flappy`
 thread 'main' panicked at 'Failed to initialize any backend! Wayland status: NoCompositorListening X11 status: XOpenDisplayFailed', /home/bjn/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.27.5/src/platform_impl/linux/mod.rs:719:9

```

The [GitHub - amethyst/bracket-lib: The Roguelike Toolkit (RLTK), implemented for Rust.](https://github.com/amethyst/bracket-lib) section on “Feature flags” says to disable default features and enable a different back-end. So first I tried this:

```
 $ grep feature Cargo.toml
 bracket-lib = { version = "~0.8.1", default-features = false, features = ["crossterm"] }

```

…but that failed with this:

```
 Running `target/debug/flappy`
 thread 'main' panicked at 'index out of bounds: the len is 5628 but the index is 6566', /home/bjn/.cargo/registry/src/github.com-1ecc6299db9ec823/bracket-terminal-0.8.7/src/hal/crossterm_be/main_loop.rs:229:25

```

And then I tried this:

```
 $ grep feature Cargo.toml
 bracket-lib = { version = "~0.8.1", default-features = false, features = ["curses"] }

```

…but that failed with this:

```
 Compiling bracket-terminal v0.8.7
 error[E0609]: no field `fitscreen` on type `curses::InitHints`
 --> /home/bjn/.cargo/registry/src/github.com-1ecc6299db9ec823/bracket-terminal-0.8.7/src/initializer.rs:455:29
 |
 455 | self.platform_hints.fitscreen = fitscreen;
 | ^^^^^^^^^ help: a field with a similar name exists: `fullscreen`

```

Help? Thanks! Brent

---

<div class="post-metadata">

**Author:** ![bjnord](https://forum.devtalk.com/user_avatar/forum.devtalk.com/bjnord/32/730_2.png) [@bjnord](https://forum.devtalk.com/u/bjnord)\
**Post date:** [11 March 2023 02:15 UTC](https://forum.devtalk.com/t/hands-on-rust-chapter-3-cant-get-first-hello-to-run/97229/2 "2023-03-11T02:15:48Z")

</div>

@herbert

Eventually I discovered I can get it to work by locking bracket-lib to 0.8.1 (looks like something has changed between that and the latest 0.8.7). The `Cargo.toml` that works for me now has:

```auto
[dependencies]
bracket-lib = { version = "=0.8.1", default-features = false, features = ["crossterm"] }
bracket-terminal = { version = "=0.8.1", default-features = false }

```

---

<div class="post-metadata">

**Author:** ![callenb](https://forum.devtalk.com/letter_avatar_proxy/v4/letter/c/90ced4/32.png) [@callenb](https://forum.devtalk.com/u/callenb)\
**Post date:** [7 January 2025 19:49 UTC](https://forum.devtalk.com/t/hands-on-rust-chapter-3-cant-get-first-hello-to-run/97229/3 "2025-01-07T19:49:45Z")

</div>

I’ve just come across this issue, and your reply fixed it, but the console appeared in my tmux pane, and left me without a cursor once I used `CTRL + c` to exit it. I found I just had to specifyy the versions of the two crates thus:

```toml
[dependencies]
bracket-lib = "=0.8.1"
bracket-terminal = "=0.8.1"

```

Thank You
