edit icon indicating copy to clipboard operation
edit copied to clipboard

Homebrew support

Open gperdomor opened this issue 6 months ago • 16 comments

Please provide an easy way to install it on mac through homebrew

gperdomor avatar Jun 21 '25 14:06 gperdomor

I tried compiling on macOS Sequoia on Apple Silicon and when I execute edit it just displays a black screen and locks up my terminal window.

MacMini ➜  edit git:(main) cargo build --config .cargo/release.toml --release
   Compiling compiler_builtins v0.1.160 (/Users/justin/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/compiler-builtins/compiler-builtins)
   Compiling core v0.0.0 (/Users/justin/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core)
   Compiling libc v0.2.174
   Compiling std v0.0.0 (/Users/justin/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std)
   Compiling libc v0.2.172
   Compiling edit v1.2.1 (/Users/justin/Sites/edit)
   Compiling rustc-std-workspace-core v1.99.0 (/Users/justin/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/rustc-std-workspace-core)
   Compiling alloc v0.0.0 (/Users/justin/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/alloc)
   Compiling panic_abort v0.0.0 (/Users/justin/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/panic_abort)
   Compiling cfg-if v1.0.1
   Compiling rustc-demangle v0.1.25
   Compiling unwind v0.0.0 (/Users/justin/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/unwind)
   Compiling rustc-std-workspace-alloc v1.99.0 (/Users/justin/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/rustc-std-workspace-alloc)
   Compiling panic_unwind v0.0.0 (/Users/justin/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/panic_unwind)
   Compiling hashbrown v0.15.4
   Compiling std_detect v0.1.5 (/Users/justin/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/stdarch/crates/std_detect)
   Compiling rustc-std-workspace-std v1.99.0 (/Users/justin/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/rustc-std-workspace-std)
   Compiling rustc-literal-escaper v0.0.2
   Compiling proc_macro v0.0.0 (/Users/justin/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/proc_macro)
    Finished `release` profile [optimized + debuginfo] target(s) in 8.71s

MacMini ➜  edit git:(main) ./target/release/edit

nodesocket avatar Jun 22 '25 21:06 nodesocket

@nodesocket I have using MacOS with: Sequoia 15.5 and I can using this with Warp and iTerm2 (ZSH)

lunargon avatar Jun 23 '25 10:06 lunargon

Image Successfully compiled and run but the proviso is you cannot follow compilation instructions without installing rust / rustup without using homebrew. This is a rust / rustup issue. The main issue on MacOS is you have to choose the correct ANSI colors in Terminal to effectively use edit.

mattwaltbriggs avatar Jun 24 '25 17:06 mattwaltbriggs

Image Successfully compiled and run but the proviso is you cannot follow compilation instructions without installing rust / rustup without using homebrew. This is a rust / rustup issue. The main issue on MacOS is you have to choose the correct ANSI colors in Terminal to effectively use edit.

Ahh indeed, switching from Ghostty which uses xterm-256color to iTerm which uses xterm worked.

nodesocket avatar Jun 25 '25 03:06 nodesocket

For me it works without issues both in iTerm and the standard Mac terminal, with TERM=xterm-256color. MacOS Sequoia 15.5.

thomasmuders-imtf avatar Jun 25 '25 08:06 thomasmuders-imtf

Image Successfully compiled and run but the proviso is you cannot follow compilation instructions without installing rust / rustup without using homebrew. This is a rust / rustup issue. The main issue on MacOS is you have to choose the correct ANSI colors in Terminal to effectively use edit.

Ahh indeed, switching from Ghostty which uses xterm-256color to iTerm which uses xterm worked.

You can get around this, brother. I bought my first Mac a couple of months ago and almost went nuts because of that. Finally figured it out.

fakebizprez avatar Jul 04 '25 17:07 fakebizprez

Image Successfully compiled and run but the proviso is you cannot follow compilation instructions without installing rust / rustup without using homebrew. This is a rust / rustup issue. The main issue on MacOS is you have to choose the correct ANSI colors in Terminal to effectively use edit.

Ahh indeed, switching from Ghostty which uses xterm-256color to iTerm which uses xterm worked.

Here you go -- this is from my .zshrc config:

if [[ -n "$SSH_CONNECTION" ]] && [[ "$TERM" == "xterm-ghostty" ]]; then
  export TERM="xterm-256color"
fi

# Remove annoying paste warning during SSH
unset zle_bracketed_paste

fakebizprez avatar Jul 04 '25 17:07 fakebizprez

Image Successfully compiled and run but the proviso is you cannot follow compilation instructions without installing rust / rustup without using homebrew. This is a rust / rustup issue. The main issue on MacOS is you have to choose the correct ANSI colors in Terminal to effectively use edit.

Now it is unneeded to tweak the colors in Terminal.app for displaying properly since macOS 26 finally makes it support 24-bit true-color.

W1gglyAshh avatar Jul 05 '25 07:07 W1gglyAshh

Image Successfully compiled and run but the proviso is you cannot follow compilation instructions without installing rust / rustup without using homebrew. This is a rust / rustup issue. The main issue on MacOS is you have to choose the correct ANSI colors in Terminal to effectively use edit.

Now it is unneeded to tweak the colors in Terminal.app for displaying properly since macOS 26 finally makes it support 24-bit true-color.

Great news. Now all we need is the release.

mattwaltbriggs avatar Jul 05 '25 10:07 mattwaltbriggs

any where i can direct download binary for my mac m1?

cornradio avatar Jul 07 '25 03:07 cornradio

any where i can direct download binary for my mac m1?

You unfortunately need to compile it yourself. But it's not complicated, follow the instructions. Install rustup with homebrew and then you can compile it. Worked well for me.

thomasmuders-imtf avatar Jul 07 '25 06:07 thomasmuders-imtf

Image Successfully compiled and run but the proviso is you cannot follow compilation instructions without installing rust / rustup without using homebrew. This is a rust / rustup issue. The main issue on MacOS is you have to choose the correct ANSI colors in Terminal to effectively use edit.

Ahh indeed, switching from Ghostty which uses xterm-256color to iTerm which uses xterm worked.

You can get around this, brother. I bought my first Mac a couple of months ago and almost went nuts because of that. Finally figured it out.

when I launch edit from ghostty I get a blank screen until I resize the window, setting TERM=xterm doesn't help.. any ideas?

edit, it's a bug in ghostty #132

gfody avatar Jul 16 '25 00:07 gfody

FYI, this is currently being worked on by @Zoobdude:

  • https://github.com/Homebrew/homebrew-core/pull/225837

The current blocker is fixing the automated test:

test do
  PTY.spawn(bin/"edit", "test.txt") do |r, w, pid|
    w.write "test data"
    sleep 1
    w.write "\u0011" # Ctrl+Q
    sleep 1
    w.write "\r" # Enter key to save
  rescue Errno::EIO
    # Expected error when PTY closes
  end
  assert_match "test data", (testpath/"test.txt").read
end

osalbahr avatar Jul 22 '25 15:07 osalbahr

@cornradio You may try MacPorts.

polluks avatar Aug 07 '25 12:08 polluks

MacOS 26 has been kind to Microsoft Edit. Image

mattwaltbriggs avatar Sep 17 '25 04:09 mattwaltbriggs

It has been added to Homebrew!

  • https://github.com/Homebrew/homebrew-core/pull/225837

osalbahr avatar Sep 26 '25 13:09 osalbahr