Try to avoid to hit Enter key when connect to ssh server on macOS.

pull/111/merge
Apex Liu 2018-09-29 00:14:30 +08:00
parent 05d91e0610
commit ce112adc87
3 changed files with 12 additions and 2 deletions

0
client/tp_assist_macos/apple-scripts/compile.sh Normal file → Executable file
View File

View File

@ -10,7 +10,7 @@ on CommandRun(theCmd, theProfile, theTitle)
if it is not running then if it is not running then
tell application "iTerm" tell application "iTerm"
activate activate
delay 0.2 delay 0.5
try try
close first window close first window
end try end try
@ -24,9 +24,12 @@ on CommandRun(theCmd, theProfile, theTitle)
end try end try
tell the current window tell the current window
tell the current session tell the current session
delay 0.5
set name to theTitle set name to theTitle
set profile to theProfile set profile to theProfile
write text theCmd write text theCmd
delay 0.5
write text "useless"
end tell end tell
end tell end tell
end tell end tell
@ -43,14 +46,18 @@ on CommandRun(theCmd, theProfile, theTitle)
end try end try
tell the current tab tell the current tab
tell the current session tell the current session
delay 0.5
set name to theTitle set name to theTitle
write text theCmd write text theCmd
delay 0.5
write text "useless"
end tell end tell
end tell end tell
end tell end tell
end tell end tell
on error msg on error msg
--if all iTerm windows are closed the app stays open. In this scenario iTerm has no "current window" and will give an error when trying to create the new tab. -- if all iTerm windows are closed the app stays open. In this scenario iTerm has
-- no "current window" and will give an error when trying to create the new tab.
tell application "iTerm" tell application "iTerm"
try try
create window with profile theProfile create window with profile theProfile
@ -59,8 +66,11 @@ on CommandRun(theCmd, theProfile, theTitle)
end try end try
tell the current window tell the current window
tell the current session tell the current session
delay 0.5
set name to theTitle set name to theTitle
write text theCmd write text theCmd
delay 0.5
write text "useless"
end tell end tell
end tell end tell
end tell end tell