I mainly use Perforce from terminal; I don't use BBEdit. For years whenever
I execute 'p4 submit' from the terminal, TextEdit would launch. I would
modify the change description then quit TextEdit to submit the change my
Perforce repository.
Now when I execute 'p4 submit' BBEdit is launched and in the terminal
Perforce returns the error, "Change description missing. You must enter
one." Does anyone know why? I finally added the change description from the
command line and unfortunately submitted more files than I intended! Very
discouraging.
This may be more of a Finder question. I'm not sure. I've also noticed that
whenever I download .txt files from Safari that BBEdit launches instead of
TextEdit. Does anyone know the answer?
Thanks,
Chuck
> I mainly use Perforce from terminal; I don't use BBEdit. For years
> whenever
> I execute 'p4 submit' from the terminal, TextEdit would launch. I
> would
> modify the change description then quit TextEdit to submit the
> change my
> Perforce repository.
>
> Now when I execute 'p4 submit' BBEdit is launched and in the terminal
> Perforce returns the error, "Change description missing. You must
> enter
> one." Does anyone know why? I finally added the change description
> from the
> command line and unfortunately submitted more files than I intended!
> Very
> discouraging.
I'm not sure what could have changed on your machine to cause this
behavior.
I intentionally use BBEdit as my command line editor.
EDITOR=bbedit --wait --resume
This works great with p4.
Jim
[...]
>This may be more of a Finder question. I'm not sure. I've also noticed that
>whenever I download .txt files from Safari that BBEdit launches instead of
>TextEdit. Does anyone know the answer?
>
This means Launch Services has decided to use BBEdit rather than TextEdit
to handle such files. :-)
You can change this mapping either:
a) by getting info on a ".txt" file in the Finder and applying "Open With"
/ "Change All", or
b) by using a utility like RCDfaultApp to directly set the helper app for
files with that suffix.
Regards,
Patrick Woolsey
==
Bare Bones Software, Inc. <http://www.barebones.com>
P.O. Box 1048, Bedford, MA 01730-1048
> You may have to set P4EDITOR. The documentation at
> http://www.perforce.com/perforce/doc.082/manuals/cmdref/env.P4EDITOR.html#1044292
> makes it sound like Perforce ignores the value of EDITOR (though that
> may be incorrect).
You can set P4EDITOR if you want to set the value just for p4.
Otherwise, per the documentation you point to, p4 will fallback to
EDITOR then `vi` if P4EDITOR is not set.
(I use p4 daily, committing through `bbedit` without having P4EDITOR
set. The advice I gave was not practical, not theoretical :-)).
Jim
Perforce will prefer P4EDITOR, but if EDITOR is set, it will use that.
I set them to:
P4EDITOR="/usr/bin/bbedit --wait --resume --"
And similarly with
P4DIFF="/usr/bin/bbdiff --"
P4MERGE="/Applications/p4merge.app/Contents/MacOS/p4merge"
-Charles
char...@pobox.com
Thanks for everyone's fast responses to my questions about using Perforce.
After a few days, I'm finally trying to fix this.
I discovered that my P4 variables are in ~/.bash_profile. I plan to add the
following line to that file:
P4EDITOR="/usr/bin/bbedit --wait --resume --"
After I've done that, is there a way I can force my user account accept
changes made to .bash_profile without logging out and back in? I think this
is a basic Unix question.
I noticed that P4V Preferences has a tab for setting the editor as well.
Perhaps, this is an alternate way to set the P4EDITOR. Also, the following
link mentions EDITOR_SIGNATURE, the four-character creator for Mac.
<http://www.perforce.com/perforce/doc.082/manuals/cmdref/env.P4EDITOR.html#1
044292>
I plan to start using BBEdit as my P4 command line editor. When I used
TextEdit as my P4 command line editor (such as modifying change description
during a submit), I had quit TextEdit for the command to be accepted. Is
there a way to have BBEdit (or TextEdit) accept the command without quitting
the app?
Thanks very much,
Chuck
or
These variables will then be available to all programs.
- Steve
I believe you want to add that line to your ~/.bashrc file, as that's
used for interactive shells. I could have my details wrong on that,
though.
When you open a new terminal window, it will get the new environment
variable. To update existing windows, do:
source ~/.bash_rc
I don't specify P4EDITOR; just EDITOR. That way you get BBEdit for
anything that wants to open an editor, like Perforce, Subversion,
mutt, etc.
> I noticed that P4V Preferences has a tab for setting the editor as
> well.
> Perhaps, this is an alternate way to set the P4EDITOR. Also, the
> following
> link mentions EDITOR_SIGNATURE, the four-character creator for Mac.
> <http://www.perforce.com/perforce/doc.082/manuals/cmdref/env.P4EDITOR.html#1
> 044292>
To the best of my knowledge, settings made in P4V only affect P4V.
Don't use EDITOR_SIGNATURE. You want to use the bbedit command line
tool as the interface to have the best experience.
> I plan to start using BBEdit as my P4 command line editor. When I used
> TextEdit as my P4 command line editor (such as modifying change
> description
> during a submit), I had quit TextEdit for the command to be
> accepted. Is
> there a way to have BBEdit (or TextEdit) accept the command without
> quitting
> the app?
With the --wait --resume set, saving then closing the commit window
will allow Perforce to proceed.
Steve
I finally figured out that I needed to add "export P4EDITOR" to my
.bash_login file. After I did 'source ~/.bash_login' it was working
properly. Okay, I'm making progress.
I'll consider changing P4EDITOR to EDITOR later.
> I don't specify P4EDITOR; just EDITOR. That way you get BBEdit for
> anything that wants to open an editor, like Perforce, Subversion,
> mutt, etc.
>
>> I noticed that P4V Preferences has a tab for setting the editor as
>> well.
>> Perhaps, this is an alternate way to set the P4EDITOR. Also, the
>> following
>> link mentions EDITOR_SIGNATURE, the four-character creator for Mac.
>> <http://www.perforce.com/perforce/doc.082/manuals/cmdref/env.P4EDITOR.html#1
>> 044292>
>
> To the best of my knowledge, settings made in P4V only affect P4V.
>
> Don't use EDITOR_SIGNATURE. You want to use the bbedit command line
> tool as the interface to have the best experience.
>
Okay, thanks. I tend to prefer the command line interface, but I
occasionally use P4V.
>> I plan to start using BBEdit as my P4 command line editor. When I used
>> TextEdit as my P4 command line editor (such as modifying change
>> description
>> during a submit), I had quit TextEdit for the command to be
>> accepted. Is
>> there a way to have BBEdit (or TextEdit) accept the command without
>> quitting
>> the app?
>
> With the --wait --resume set, saving then closing the commit window
> will allow Perforce to proceed.
>
> Steve
This works, but I don't know how to cancel or terminate a command. From the
terminal, I'm unable to use control-C. In BBEdit, once I save the temp file,
I don't see how to cancel the command. Any suggestions on how to cancel a
command after the temp file is open? Sometimes I start editing and save a
Perforce spec (temp file) then realize that I don't want the command
executed.
Thanks,
Chuck
As long as you don't save the window first, you can close it, and then
Control-C the bbedit tool running in the terminal.
Steve
>
>>>
>>> With the --wait --resume set, saving then closing the commit window
>>> will allow Perforce to proceed.
>>>
>>> Steve
>>
>> This works, but I don't know how to cancel or terminate a command.
>> From the
>> terminal, I'm unable to use control-C. In BBEdit, once I save the
>> temp file,
>> I don't see how to cancel the command. Any suggestions on how to
>> cancel a
>> command after the temp file is open?
The --wait tells the terminal to wait until the command is completed.
It is completed when you close the window you opened.
> As long as you don't save the window first, you can close it, and then
> Control-C the bbedit tool running in the terminal.
I use BBEdit as my 'vi' and I've never had to ^C it after closing the
window.