# Unable to run commands in Lens terminal

**URL:** https://forums.k8slens.dev/t/unable-to-run-commands-in-lens-terminal/1891
**Category:** Lens Support & Troubleshooting
**Tags:** macos, lens-desktop
**Created:** [October 20, 2023, 12:21pm UTC](https://forums.k8slens.dev/t/unable-to-run-commands-in-lens-terminal/1891 "2023-10-20T12:21:21Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![chika.madu21](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/c/6a8cbe/32.png) [@chika.madu21](https://forums.k8slens.dev/u/chika.madu21)
#### Post date: [October 20, 2023, 12:21pm UTC](https://forums.k8slens.dev/t/unable-to-run-commands-in-lens-terminal/1891/1 "2023-10-20T12:21:22Z")

</div>

Recently, I noticed that some of my kubernetes contexts, when I access them via Lens, I can’t run kubectl commands in the Lens terminal, but using the same context on the native Mac Terminal, allows me run kubectl commands.

For context, the error I keep getting is 137 [1] killed . This error is usually from K8s pods, so I am not sure why I am getting the error without being connected to any pod. Any ideas would be great. Thanks

---

<div class="post-metadata">

### Author: ![chika.madu21](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/c/6a8cbe/32.png) [@chika.madu21](https://forums.k8slens.dev/u/chika.madu21)
#### Post date: [October 20, 2023, 6:05pm UTC](https://forums.k8slens.dev/t/unable-to-run-commands-in-lens-terminal/1891/2 "2023-10-20T18:05:58Z")

</div>

So I followed the recommendation here: [Kubectl is killed in lens desktop terminal, cannot exec to pods](https://forums.k8slens.dev/t/kubectl-is-killed-in-lens-desktop-terminal-cannot-exec-to-pods/554), which meant I changed my kubectl binary path, to the very one being used by the terminal. After restarting, the terminal no longer comes up, just stays stuck in “Connecting…”

---

<div class="post-metadata">

### Author: ![tannb](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/t/b38774/32.png) [@tannb](https://forums.k8slens.dev/u/tannb)
#### Post date: [October 21, 2023, 4:44am UTC](https://forums.k8slens.dev/t/unable-to-run-commands-in-lens-terminal/1891/3 "2023-10-21T04:44:15Z")

</div>

Yeah, I got the same issue when updated to version 2023.9.290703 on MacOS [https://forums.k8slens.dev/t/can-not-exec-to-pod-when-update-2023-9-290703-on-macos/1799/1](https://forums.k8slens.dev/t/can-not-exec-to-pod-when-update-2023-9-290703-on-macos/1799/1). They said that the issue was caused by a timeout read config or something to connect to the shell, and they will increase the timeout in the next version.

I am still waiting, you can exec by yourself instead, for ex: `k exec pod-name -it -c container-name -n namespace -- /bin/sh`

---

<div class="post-metadata">

### Author: ![chika.madu21](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/c/6a8cbe/32.png) [@chika.madu21](https://forums.k8slens.dev/u/chika.madu21)
#### Post date: [October 23, 2023, 10:46am UTC](https://forums.k8slens.dev/t/unable-to-run-commands-in-lens-terminal/1891/4 "2023-10-23T10:46:53Z")

</div>

Thanks for the info @tannb. I’d keep my eyes peeled for further updates on this

---

<div class="post-metadata">

### Author: ![raghavarora1306](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/r/dbc845/32.png) [@raghavarora1306](https://forums.k8slens.dev/u/raghavarora1306)
#### Post date: [February 26, 2025, 9:12am UTC](https://forums.k8slens.dev/t/unable-to-run-commands-in-lens-terminal/1891/5 "2025-02-26T09:12:53Z")

</div>

firstly check your terminal session in lens, by doing which kubectl . Mine is  
raghavarora@raghav ~ % which kubectl  
/Users/raghavarora/Library/Application Support/Lens/binaries/kubectl/1.30/kubectl

then override the lens path for kubectl by creating a symlink

ln -sf /usr/local/bin/kubectl /Users/raghavarora/Library/Application Support/Lens/binaries/kubectl/1.30/kubectl

Restart the lens it will work.
