0

I am getting this error whenever I try to open Gedit on WSL on Ubuntu terminal:

(gedit:3271): Gtk-WARNING **: 00:10:01.110: cannot open display: 

Please suggest a fix to it. Thank you.

Zanna
  • 70,465
  • Ubuntu in WSL is by default CLI only so the error message is correct because there is no display. Not an error, it's exactly how it should be. – ChanganAuto Dec 14 '22 at 01:39
  • So, how can i use gedit in wsl linux? – Ramit Bose 21BCE1316 Dec 15 '22 at 02:39
  • Why do you think you need to use gedit? – ChanganAuto Dec 15 '22 at 11:01
  • Then in which editor do I type my c program and stuff? – Ramit Bose 21BCE1316 Dec 16 '22 at 12:50
  • 1
    @RamitBose21BCE1316 You are probably just running on a slightly outdated WSL release. WSL now supports the ability to run GUI applications for both Windows 10 and 11, but you'll need to upgrade first. If you've already upgraded, though, let me know and we'll look for other causes. As for "which editor", the typical recommendation on WSL is to use the Windows version of Visual Studio Code, with the WSL extension. This will fully integrate the Windows VSCode with WSL. – NotTheDr01ds Dec 24 '22 at 16:13
  • @ChanganAuto Just for clarity/update, WSL by default now has GUI support. It's likely the OP just hasn't updated to the latest Windows/WSL release, but it's available for all users now. – NotTheDr01ds Dec 24 '22 at 16:14
  • @RamitBose21BCE1316 One final note, though - If you are going to be editing C code, I highly recommend that you get used to the vi key bindings anyway. You can run vi (or Neovim) directly from the terminal without requiring any overhead of a graphical application. But even when using VSCode, I recommend the vi keybindings -- Once you invest the time in learning them, it will make editing so much faster in the future. – NotTheDr01ds Dec 24 '22 at 16:16

0 Answers0