Proxyman icon indicating copy to clipboard operation
Proxyman copied to clipboard

Add support custom terminal like iterm2 for automatic setup

Open fleitman opened this issue 1 year ago • 6 comments

Description

At the moment, the documentation says:

Only the pre-configured Terminal app is able to capture HTTP traffic out of the box. If you would like to use your own Terminal app (e.g. iTerm2, Hyper, etc), please use the Manual Setup.

The result is a flow of 3 taps

  1. Click Setup
  2. Click Automatic Setup
  3. Open new terminal

Changes to flow

  1. Click Setup
  2. Click Manual Setup
  3. Click copy to Clipboard
  4. Open the appropriate terminal
  5. Enter command+v
  6. Press enter

At a minimum I would like to be able to select a terminal for auto tuning Ideally, I would like a more user-friendly interface, for example, a button that immediately opens the terminal in 1 click, and with the hotkey held down, for example, option copied to the clipboard

Why this feature/change is important?

Because now it is not particularly clear that you need to poke "Setup" and you have to Google to configure the terminal, this requires an excessive number of clicks.

fleitman avatar Jun 17 '24 12:06 fleitman

Thanks for opening the ticket.

I support the built-in Terminal app because it natively supports Apple Script. From what I remember, I had some problems with iTerm2 with the AppScript, and I couldn't find any feasible solution, so I skipped it.

Let me re-investigate and find an alternative solution 👍

NghiaTranUIT avatar Jun 17 '24 13:06 NghiaTranUIT

Try:

tell application "iTerm"
	set newWindow to (create window with default profile)
	tell current session of newWindow
		write text "set -a && . ~/.proxyman/proxyman_env_automatic_setup.sh && set +a"
	end tell
end tell

fleitman avatar Jun 17 '24 20:06 fleitman

Or for new tab

tell application "iTerm"
	activate
	delay 0.5 -- A small delay for iTerm to create a window
	if (count of windows) is 0 then
		set newWindow to (create window with default profile)
		tell current session of newWindow
		end tell
	else
		tell current window
			set newTab to (create tab with default profile)
			delay 0.5 -- A small delay for iTerm to create a tab
			set newSession to current session of newTab
		end tell
	end if
	tell newSession
		write text "set -a && . ~/.proxyman/proxyman_env_automatic_setup.sh && set +a"
	end tell
end tell

fleitman avatar Jun 17 '24 20:06 fleitman

Thanks @fleitman , let's try this Beta build: https://download.proxyman.io/beta/Proxyman_5.5.0_support_auto_setup_for_iTerm2.dmg

  • You can choose your own favorite Terminal apps. For now, it's Apple Terminal or iTerm 2
  • Remember your last choice

CleanShot 2024-06-18 at 10 10 58@2x

NghiaTranUIT avatar Jun 18 '24 03:06 NghiaTranUIT

@NghiaTranUIT yes, the iterm2 setup now works via proxyman. Perhaps you should add a check mark so that instead of a new window it makes a new tab (it's not very critical for me, since I was still looking for a solution for you, I already bind the apple script :))

What do you think about improving usability in this area?

Ideally, I would like a more user-friendly interface, for example, a button that immediately opens the terminal in 1 click, and with the hotkey held down, for example, option copied to the clipboard

fleitman avatar Jun 18 '24 12:06 fleitman

Update with new Apple Script for iTerm 2: https://download.proxyman.io/beta/Proxyman_5.5.0_Improve_iterm2_apple_script.dmg

  • Prefer open new tab, instead of new windows 👍

Ideally, I would like a more user-friendly interface, for example, a button that immediately opens the terminal in 1 click, and with the hotkey held down, for example, option copied to the clipboard

IMO, it's better to show the Auto and Manual Setup since it's easier to understand. From my experience, users might not be aware that holding the Option and clicking will copy to the clipboard.

Manual Setup also displays the command line, so power users will understand what is going on.

NghiaTranUIT avatar Jun 19 '24 03:06 NghiaTranUIT