AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
What is a terminal window in bbedit2/15/2024 I suppose I could have done this entirely in AppleScript with an on run routine, but I don’t know how to get an absolute path from a partial path in AppleScript. I’ll just link to the parts of the zsh user manual that cover the :a modifier used in Line 4 to expand the filename argument to its full absolute path and the << redirection that creates a here-document out of the AppleScript code between the OSAEND strings and feeds it to the osascript command.Īs far as I can tell, BBEdit doesn’t have an AppleScript for setting Tail Mode directly, but by setting the language to Log File in Line 14, I achieve the same result. I think the comments explain everything reasonably well. By setting the sourceħ: # language to Log File, the Text Display will be set to Tail Mode.Ĩ: # This works for BBEdit 14.5 and later. You can use this to open a preview on an existing file, remote URL, or pipe data without opening a. Here’s my combination shell script/AppleScript: bash:ģ: # Get the absolute path to the file argument.Ħ: # Open the file in BBEdit and go to the end. The bbedit command-line tool gets a new argument: -preview. Yesterday, Mark Gardner had a great idea:Īlready emailed asking for a bbedit -f or bbtail commandĪlthough I have a feeling Rich Siegel will soon have a bbtail command to go along with bbdiff and bbfind, I couldn’t wait. log extension are opened with their language set to Log File and Tail Mode on. You can also set a file’s language to Log File, which will turn Tail Mode on without any other action from you. Here, we are telling ps to give complete details and to put the result into a new document and to scroll the window to the top of the document. For example, the ps (process status) command can generate some extremely long lines. To turn on Tail Mode, you can choose the View‣Text Display‣Tail Mode menu item or bring up the Text Options window and check the Tail Mode box. Invoke BBEdit from the command line and pass the results to a document. What I like about Tail Mode is that it works like tail -f but by doing so in a BBEdit window, all my ingrained habits for searching and copying text will work, which they don’t in Terminal or iTerm. It is this use of tail that gives Tail Mode its name. There’s also the old-school way of using the “follow” option to the tail command in a Terminal window: tail -f /var/log/system.log MacOS has the Console app for doing this, but I’ve never liked Console. Lots of processes send information (errors, connections, etc.) to log files, and when you’re debugging code, it’s often very useful to be able to see the log file update in real time. It’s a way of viewing a log file in a way that persistently updates as new text is added to the file. Next post Previous post BBEdit, Tail Mode, and bbtailĪ new version of BBEdit, 14.5, was released a couple of days ago, and the feature that caught my eye was Tail Mode.
0 Comments
Read More
Leave a Reply. |