# Edit() doesn't use JULIA\_EDITOR

**URL:** <https://discourse.julialang.org/t/edit-doesnt-use-julia-editor/110136>\
**Category:** General Usage\
**Tags:** interactiveutils\
**Created:** [February 13, 2024, 9:50am UTC](https://discourse.julialang.org/t/edit-doesnt-use-julia-editor/110136 "2024-02-13T09:50:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alseidon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alseidon/32/207775_2.png) [@Alseidon](https://discourse.julialang.org/u/Alseidon)\
**Post date:** [February 13, 2024, 9:50am UTC](https://discourse.julialang.org/t/edit-doesnt-use-julia-editor/110136/1 "2024-02-13T09:50:50Z")

</div>

I defined the environment variable JULIA\_EDITOR=“gedit” in my `startup.jl` file, but `edit(path)` or `edit(fn)` still open with nano:

```julia
shell> echo $JULIA_EDITOR
gedit

julia> edit(
    "~/.julia/juliaup/julia-1.10.0+0.x64.linux.gnu/share/julia/stdlib/v1.10/LinearAlgebra/src/lapack.jl"
) # this will open nano

julia> edit(LAPACK.gels!, 1) # same

```

Is this a bug?

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [February 13, 2024, 10:04am UTC](https://discourse.julialang.org/t/edit-doesnt-use-julia-editor/110136/2 "2024-02-13T10:04:53Z")

</div>

> [@Alseidon](#):
>
> I defined the environment variable JULIA\_EDITOR=“gedit” in my `startup.jl` file

How?

Try:

```julia
ENV["JULIA_EDITOR"] = "gedit"

```

For me, on 1.10, if I do that (in the REPL) I get:

```julia
julia> @edit println("Hello world!")
ERROR: IOError: could not spawn `gedit +4:0 /home/pharaldsson/.julia/juliaup/julia-1.10.0+0.x64.linux.gnu/share/julia/base/coreio.jl`: no such file or directory (ENOENT)

```

I think that simply means it would be “working”, only that “no such file” refers to `gedit`, i.e. it not in `PATH`.

I get the same with:

```julia
julia> edit("/home/pharaldsson/.julia/juliaup/julia-1.10.0+0.x64.linux.gnu/share/julia/base/coreio.jl")
ERROR: IOError: could not spawn `gedit +0:0 /home/pharaldsson/.julia/juliaup/julia-1.10.0+0.x64.linux.gnu/share/julia/base/coreio.jl`: no such file or directory (ENOENT)

```

so at least there’s no difference.

Note for me, then:

```julia
shell> echo $JULIA_EDITOR
ERROR: UndefVarError: `JULIA_EDITOR` not defined

but:

shell> bash
pharaldsson@ryksugan:~$ echo $JULIA_EDITOR
gedit

```

---

<div class="post-metadata">

**Author:** ![Alseidon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alseidon/32/207775_2.png) [@Alseidon](https://discourse.julialang.org/u/Alseidon)\
**Post date:** [February 13, 2024, 10:08am UTC](https://discourse.julialang.org/t/edit-doesnt-use-julia-editor/110136/3 "2024-02-13T10:08:14Z")

</div>

> [@Palli](#):
>
> How?
> 
> Try:
> 
> `ENV["JULIA_EDITOR"] = "gedit"`

This was it! I wrote `JULIA_EDITOR=“gedit”` in `startup.jl`, thinking I was in bash… Writing `ENV["JULIA_EDITOR"] = "gedit"` solved this.
