Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emacs: Could not open file: /dev/tty #27

Closed
umutzd opened this issue Aug 23, 2020 · 6 comments
Closed

emacs: Could not open file: /dev/tty #27

umutzd opened this issue Aug 23, 2020 · 6 comments
Labels
bug Something isn't working

Comments

@umutzd
Copy link

umutzd commented Aug 23, 2020

I can't run emacs with either of the X Server software mentioned in the Readme file. Tried both of them, especially VcXsrv access disabled mode. I run them and I can confirm that they are running by looking at the task manager.

When I issue these commands:

export DISPLAY=:0
export LIBGL_ALWAYS_INDIRECT=1
setsid emacs

The output is:

Display :0 unavailable, simulating -nw
emacs: Could not open file: /dev/tty

I don't know if there's anything to do with SSH or something else. I think I read it thoroughly.

Output of uname -a command:

Linux DESKTOP-0Q60T4A 4.19.104-microsoft-standard #1 SMP Wed Feb 19 06:37:35 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
@hubisan hubisan added the bug Something isn't working label Aug 24, 2020
@hubisan
Copy link
Owner

hubisan commented Aug 24, 2020

  1. Are you using WSL1?
    The guide has not yet been updated to work with WSL2. If your are using WSL2 check out add instructions for WSL2 #3.

  2. Default terminal emulator wsl.exe?
    Are you using the default terminal emulator that comes with WSL?
    That's wsl.exe at probably C:\Windows\System32\wsl.exe?
    What is the output of echo $TERM? Is it xterm-256color?

  3. Emacs in Terminal working?
    Open WSL and run

    emacs -nw -q

    This should open Emacs in the terminal without loading your init.el.

  4. Try without setsid and without loading the init file.
    Open WSL and run:

    export DISPLAY=:0.0
    emacs -q

@hubisan
Copy link
Owner

hubisan commented Aug 28, 2020

@Umucorn Were you able to solve your issue?

@umutzd
Copy link
Author

umutzd commented Aug 28, 2020

Hi, I solved this problem by following the instructions for WSL2. I was using WSL2.

@umutzd
Copy link
Author

umutzd commented Aug 28, 2020

But now, If I issue the command emacs everything starts correctly.

Not when I run this:

alias eme='
export DISPLAY_NUMBER="0.0"
export DISPLAY=$(grep -m 1 nameserver /etc/resolv.conf | awk "{print $2}"):$DISPLAY_NUMBER
export LIBGL_ALWAYS_INDIRECT=1
setsid emacs
exit
'

I issue eme command and everything disappears suddenly.

@umutzd
Copy link
Author

umutzd commented Aug 28, 2020

I solve this problem by changing eme alias to this and moving exports anywhere else:

alias eme='
setsid emacs -q
exit
'

@umutzd umutzd closed this as completed Aug 29, 2020
@whompyjaw
Copy link

Hi, I solved this problem by following the instructions for WSL2. I was using WSL2.

Can you elaborate on which instructions you followed exactly? There are several options for each problem it seems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants