Octave clc does not clean the command window - octave

In matlab, clc will totally clean the command window. You can't traverse the history using scroll bar. In Octave, it does clean but the history still can be accessed using scroll bar. This is pretty annoying when debugging.
This behavior is observed with Octave 6.2.0 on Ubuntu 20.04, installed via snap.

Related

Octave gets stuck on Busy... inside TeXmacs in Windows OS

I have TeXmacs and Octave installed, both working properly otherwise. I have also added the path to octave executable (i.e. C:\Octave\Octave-5.1.0.0\mingw64\bin) to the Windows environment variables and octave runs in cmd/PowerShell terminals and Jupyter with no hassle. However, when running Octave inside TeXmacs through Toolbar > insert > session > octave it gets stuck on Busy..., the same reaction for any other commands as well:
Octave gets stuk on Busy... inside TeXmacs.
This is my environment:
TeXmacs 1.99.9
Octave 5.1.0 (installed through Chocolatey)
Windows 10 version 1809
I would appreciate if you could help me know what is the problem and how I can solve it.
P.S. I have reported this issue in the TeXmacs repo.
#Foad. I wrote an updated Octave plugin for Texmacs. I tried it on Windows, OSX and Linux, works on the systems I have access to. If you are interested to test it, you can download the zipped archive from here https://lists.gnu.org/archive/html/texmacs-dev/2019-12/msg00005.html.
To install it, unzip the archive and copy the octaveX directory in the application plugins folder, alongside all the plugins that come with the standard Texmacs installation. Won’t work if installed in ~/.Texmacs/plugins. If everything goes fine, you should find a new Insert/Session/OctaveX menu (note: I changed the session name). If not, try to refresh the plugin system with the menu Tools/Update/Plugins. If you try it, please let me know, especially if you find troubles. In case I will do my best to fix them.
A fundamental prerequisite is a working octave-cli command in a operating system shell. Should be standard on Linux, may require some additional setup on Windows (environmental variables) or OSX (.bash_profile). You can find some help and more details under the menu Help/Plug-ins/OctaveX.
Concerning the error you found, as far I understand there are some issues with the standard distributed plugin: first, a .octaverc file is missing, so several variables are not initialized, in addition the Windows version calls a not existent file. Moreover the plotting functions are quite old and are not compatibile with Octave newer than version 2 (or maybe 3, anyway a quite old version).
You could try to run the command in
%TEXMACS_PATH%/plugins/octave/bin/tm_octave.bat
from the terminal to see what happens. There is a problem with this plugin and it does not work also on Mac but I do not know enough Octave to fix it. Somehow it does not manage to find the files which are in
%TEXMACS_PATH%/plugins/octave/octave
Please try to modify tm-start.m to look like
d=getenv("TEXMACS_PATH");
if (length(d) > 0)
addpath("tm:polynomial:plot")
tmrepl
endif
In windows, octave should be run using the scripts octave.bat (in the mingw64\bin directory of the octave install) or octave.vbs (in the install directory) for the GUI
You should not run octave.exe directly.

Unable to display Octave figure in Atom on MacOS

I tried few different terminal implementations such as terminal-plus or platformio-ide-terminal on Atom (1.38.2) to run some Octave exercises. I noticed that the Octave shell runs normally until I try to plot anything.
When I type figure into the shell no window pops up and no error or any other messages appear in the terminal. Yet everything runs OK in Mac (Mojave 10.14.5) own terminal
Figured it out. The popup is there but it is buried under Atom itself. If I call figure(gcf) instead of simply figure it brings the window to the foreground and displays above the IDE. If anyone has a better answer I'll be happy to accept

How to use the left and right arrow keys in the tclsh interactive shell (Ubuntu 14.04)?

Why can't I use the left and right arrow keys (actually, the same goes for the up and down keys as well) to move about the line I'm currently on in the tclsh interactive shell? If I try to press either one, I get a bunch of abracadabra instead of moving back and forth. This is not all that convenient when, for example, you make a typo, but you can't move the cursor back to change it. You have to use the backspace key to erase all the stuff that you've typed after the place where the typo is located thereby destroying all your work. Is it possible to fix this, quite frankly, buggy behaviour?
The behaviour isn't buggy. It is inconvenient yes.
To get editing in a shell, usually the GNU readline library is used. If a program doesn't use that library, you don't have that feature.
For tclsh there are licensing reasons (GPL vs. BSD style Tcl license), which make it inconvenient to add readline support directly to tclsh for all those platforms where readline is not part of the operating system (nearly everything but Linux).
You can use the Ubuntu rlwrap package to still get the editing you want.
Install rlwrap:
sudo apt-get install rlwrap
And use it to run tclsh with command line editing:
rlwrap -c tclsh
Another option would be to use the Tk based shell tkcon, which provides a bit more options as a Tcl shell, its available as a ubuntu package too.
Expanding my own answer: You can also build and use tclreadline, as a package in your .tclshrc.
You can use the the generic rlwrap as suggested by schlenk, or you can use tclreadline:
Install tclreadline (e.g. with the following command for debian/ubuntu):
sudo apt install tclreadline
Automatically load it by adding it to your ~/.tclshrc:
if {$tcl_interactive} {
package require tclreadline
::tclreadline::Loop
}
Using tclreadline does not only provide the basic editing features but also includes tab completion, which rlwrap can't do due to it's generic nature.

How do I stop octave plots hanging with line editing turned off?

I'm using Debian Jessie and GNU Octave, version 3.8.1
If I run octave with the --no-line-editing switch on, to avoid using readline
$ octave --no-line-editing
and execute this command,
>> t=0:1; plot(t);
then the plot window hangs. Without the line editing switch it's ok.
Does anyone know how to work around this, or how to report the bug?
This has already been reported as Debian Bug #675509 and Octave bug #37795 so you don't to report this bug again.
You can use gnuplot: just execute graphics_toolkit gnuplot before any plotting or add it to your .octaverc to get it eexecuted everytime you start octave.

tcl/tk on mac os, Python IDLE won't start and Macport not working properly

I really need someone's help here.
Early, I was playing around with homebrew, macport and active state TCL/TK after I got the new mac pro. But somehow I accidentally deleted the tcl/tclsh folder when I was trying to delete the active state version of tcl.
Now the problem is when I'm trying to install MongoDB with Macport using:
sudo port install mongodb
It give me an error says:
so I guess I delete the wrong file..is there any way I can get it back? I tried install tcl/tk using active state package but didn't work.
Help really needed...!
Thanks
The problem seems to be that you've deleted (at least part of) the system Tcl/Tk pre-installed by Apple.* MacPorts explicitly uses Apple's Tcl (or its own, if you ask it, but not ActiveState's or Homebrew's or any other). That's why it's looking for /usr/bin/tclsh rather than just whatever tclsh is on the PATH.
If you dig inside the Mountain Lion installer package, you may be able to find and run the Tcl/Tk installer manually, but Apple makes that different (and harder) with each release. The easier thing to do is just run the installer and let it repair things for you.
* It's also possible that you first replaced parts of Apple's Tcl with another version, which you shouldn't have done, and then broke that other version. But the solution is the same.