MobaXterm: Log all NEW terminal activity in a separate file? - windows

Is it possible (either directly or through a plugin) to log all new terminal activity?
To further explain, I have logging setup such that all terminal activity gets saved to a file in a directory of my choosing. So say I've typed out some commands & those are logged to the file. That's great. Now I want to be able to specify that all further commands typed in & whatever the result output shown on the terminal is, should be logged to a new file.
Does anyone know whether it's possible to switch log files easily?

Yes, this is possible.
You can edit the session, goto Terminal settings -> Log Output Terminal to=
and provide your log file path. The you get all your session log files in that path

Please refer to the image where to add the path.

This works for specific sessions or the top-level global configuration. I also wanted to know if there was a way to define the type of file output? For example, when you get this same information manually by right-clicking on the session tab and select the "save terminal output" command, you can then choose the "Rich Text Document" or "Plain Text" under the "Save as type:" drop-down field before clicking the save button. The file created by the auto logging is plain text.

Related

Read current terminal

Is it possible to read what's currently displayed on the windows terminal pragmatically using any available API?
For example, I've got an app that tail's some log files. I'd like to be able to hit a key and open a text editor at the line that is currently being viewed. The problem is the terminal also has scroll bars.
Not easy. Perhaps you could capture the screen and use OCR to identify its contents, or make a shortcut to some sort of macro that selects all the screen and copies the text. But there is no API available to perform the task you ask.
Of course, you can tee the command you're running in the console to a file, and open such file with an editor whenever you like, however it will show the full output of the command and not the visible part. If you like more information on that topic, it is answered in SO - Displaying Windows command prompt output and redirecting it to a file
.

Rename tab in MobaXterm for session duration

How can we rename tabs in MobaXTerm for the entire session duration? At the moment, I can right-click and rename the tabs, but as soon as I press enter to get command prompt, MobaXTerm resets tab name to its original default. I have tried changing PS1 env variable with no effect. Please help.
I haven't tried this myself but when you create a profile for a new ssh session, there is a tab "Bookmark settings" and within this tab there is a check box named "Lock terminal title." According to the manual:
Lock terminal title
Terminal title will be set to the session name
If you check this option, any attempt by the shell to set tab title will fail.
Uncheck this option if you want to allow the shell to change tab title.
Looks like you need to open every new tab as a New Session (Click on the "Session" button) and then follow what ks2000 suggested (It works for me).
There is limitation in number of sessions created for non-purchased mobaxterm. When you go for edit the session, red coloured message this message will be displayed. Delete unwanted sessions, unlock terminal title, then it will work. Otherwise purchase mobaxterm.
A bit late, but I came across this and wanted to update it.
I found the answer here:
https://stackoverflow.com/questions/29963545/rename-tab-in-mobaxterm-for-session-duration
I wrote a bash function to quickly handle this for me.
set_title() {
PROMPT_COMMAND="echo -ne \"\033]0;$1\a\""
}
set_title "webserver"
If none of the above works, just go to the sessions tab and click on the session you want to rename (just like when you want to rename a file). You should see the following:
After that, enter the preferred name and hit enter. The following window will occur:
Click yes and voilĂ !
THIS IS NOT FOR THE SESSION DURATION BUT PERMANENT

Saving Session data in a log file in Gnome-connection-manager

I am using Gnome-connection-manager on my ubuntu system. Earlier i used to have putty for windows where I was able to log all the session data to a text file.
This was done by going to path session->logging and selecting All session output. After which i gave the text file path and all the putty session used to get saved in the text file.
Can anybody let me know what is the equivalent of this in gnome connection manager?
You only have to click the "Settings" icon and fill in the "Logs Path". By default it is /home/USER.

How can i add a Right Click option/options on any specific directory of window

I am creating a directory synch application in java programming application. Now i want to add share option when user right click with in a specific directory, and want to open an dynamic url on clicking that new option. Can anyone help me to find any good solution. Can anyone provide me Registry Script For this task.
An msdn resource on Extending Shortcut Menus will be good for you.
Anyway, I'd like to introduce my own "minimal" example. This opens a gnuplot's wgnuplot terminal at the right-clicked directory after choosing "Open gnuplot here" shortcut.
You can add keys into HKEY_CLASSES_ROOT\Directory\shell. I added HKEY_CLASSES_ROOT\Directory\shell\gnuplot with string (name: (Default)) Open gnuplot here, provided an icon string with the program's icon path, a LegacyEnable empty string and a command key that windows have to execute when clicking. You can reach the right clicked directory name with %V (You can find out more special variables on this Q&A thread at SU). Here's the code that creates the structure:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\gnuplot]
#="Open gnuplot here"
"Icon"="\"C:\\Windows\\icons\\wgnuplot.ico\""
"LegacyEnable"=""
[HKEY_CLASSES_ROOT\Directory\shell\gnuplot\command]
#="\"C:\\Users\\Cron\\Documents\\egyetem\\gnuplot\\bin\\pgnuplot.exe\" -e \"cd '%V'\" -persist"

How to programmatically intercept OSX (10.8) print command?

Basically, if I'd like to be able to handle a print job initialization command. Like hitting Cmd+P on a document or something. I'd like to be able to access the data being printed and programmatically handle it rather than through a GUI.
Thanks!
You can possibly use the OSX automator to do what you need here. It depends on what you want to get out of the printed document. Automator allows you to create print plugins, which you can select from the system print dialog. I see you mentioned already that you don't want to use the "PDF" print menu as is, but perhaps some value can be added with extra automation in a print plugin. The plugin will create a .pdf of the printed documents, to which you can apply an automated sequence of actions.
Start /Applications/Automator
Under "Choose a type for your document:", choose "Print Plugin"
Then set up a sequence of actions you need to process your printed document. For example, you might want to do "Extract PDF Text" or "PDF to Images". Type "pdf" in the search field to see all the pdf-related actions available.
Save the automator workflow. You will only be able to give it a name, but not save it as a file in an arbitrary path.
You can use the plugin by opening the system print dialog in any given application, then dropping down the "PDF" menu in the bottom left-hand corner. You should see your plugin appear there.

Resources