For AIX dbx, why is there a syntax error with "set edit emacs" in the .dbxinit command file? - aix

On AIX 7.2, I am using the dbx debugger. Through a command set edit emacs one can enable an "emacs" line editing mode in dbx, which allows you to edit the current command line with keyboard shortcuts like ^A, ^K, ^Y, and so on (similar to what works on the command lines in bash and ksh), and, most importantly for me, it also allows you to access the history of commands in dbx through ^P and ^N (previous and next command, respectively). Dbx allows one to put commands in a file called ~/.dbxinit, which will have these commands executed at the start of the dbx session.
To always have the emacs mode enabled by default (and another option that repeats the last command if you press enter without entering another command) I have created the following .dbxinit file:
set $repeat
set edit emacs
However, when I start dbx now, I get the following error output:
/home/redacted/.dbxinit: 2: set edit emacs
^ syntax error
(The redacted username is also 8 characters long, so the caret for the syntax error is out of place in the original output as well.)
Is this a bug in the dbx implementation or is there anything that prevents setting the edit mode from the startup command file? Is there something else that I can write in the file to get this mode enabled by default?
When I swap the two lines of the file, the error happens on line 1 instead, so I assume that it has nothing to do with the set $repeat line.
The alternative syntax set -o emacs raises the same error. Setting the vi mode instead of emacs mode fails in the same way.
The alternative of setting the EDITOR environment variable to emacs works correctly. But I do not really want to set the editor in my shell to emacs in general, I only want to put dbx into that line editing mode.
Sources:
dbx online manpage
Section about setting the edit mode
Section that describes the use of .dbxinit
(Section about the $repeat option, assumed unrelated)

Related

How do I get my neovim settings to work properly and actually save

I just installed nvim for the first time, this is also my first time using a terminal based code editor, and I'm migrating from VSCode (ik it's going to be hard),
and now I'm configuring it, I'm following this tutorial:
https://www.youtube.com/watch?v=vdn_pKJUda8&t=347s&ab_channel=JoseanMartinez
And when put the code in the options.lua file, it does not do anything, for example, the
opt.relativenumber = true
is not doing anything
I have tried running commands to change settings, and that has worked, for example
:set relativenumber
But as soon as I exit the file and open a new one, it just breaks again
I have tried simply copy and pasting the code, restarting nvim, switching terminal emulators, etc.
It's really annoying because I am trying to get rid of this stupid feature where it continues comments to the next line and I have to run like 50 commands every time I open a new file just so I can edit it the way I want
My .config file is in
C:\Users\brady\.config
and my nvim.exe file is in
C:\Users\brady\nvim-win64\bin
I am on Windows 10 and my terminal emulator is called 'Tabby'
I figured it out! All the tutorials I am watching are on Linux, but I am on Windows. So instead of putting the nvim folder in my .config, I am supposed to put it in C:\Users\brady\AppData\Local
Are you sure that you're adding your nvim-config file in the correct directory? I'd assume that you need to add your init.vim into C:\Users\brady\.config\nvim\init.vim.
Maybe this answer helps you.

Is there a way to find output of previous runs in IntelliJ?

Every time I run some program, the output of previous run of some other program seems to be overwritten by the new output. Is there a way to see the output of previously run programs?
There is not. In the Run/Debug configuration, on the log tab, you can turn on the option "Save console output to file". (You can set this under the "Defaults" configuration so that it always there by default. That however only applies to the current project. To set as a default for all future projects as well, from the Welcome screen (i.e. close all projects) go to Configure > Project Defaults > Run Configurations) Unfortunately, that output file is (also) overwritten on each new run. To the best of my knowledge, there is no way to add a timestamp to the file name. You can open a feature request asking they enhance this to retain the last x number of runs or allow a timestamp.
In the meantime, there are two options you can use for a workaround.
Option 1 - Logging Framework
The first option is to use a logging framework. This won't include the start up information or any System.out/err that the console has (unless you use something like sysout-over-slf4j). On the same "Logs" tab in the Run/Debug configuration, you can set to have the log file shown in the console tool window. The nice thing is that IntelliJ IDEA only shows new output for that run. But the output from previous runs is still in the log file (assuming your logger is set up to append and not overwrite on new runs). When specifying the log name, you can use wild characters (to deal with things like a date stamp in the log). It use Ant fileset pattern notation. Click the help button on "Edit Log Files Aliases" dialog for more information. By default, IDEA only shows the latest log, unless you select the "Show all files coverable by pattern" on the "Edit Log Files Aliases".
Option 2 - Use a Script
Another option would be to use the "Save console file output to file" option. Then write an external script or Ant task that moves/renamed that output. (You could make it fancy so it only saves the last x runs, rolling the previous ones names.) Then in the run/debug configuration, use either the "Run External tool" or "Run Ant Target" option in the "Before Launch" section to run your script. (Again, you can set this on the default configurations so it is there automatically.) This way your script will run, renaming the file, before the new output is created and overwrites the old.
In addition to the options mentioned by Javaru, it is possible to tell IntelliJ to save all console outputs til a local file:
Edit Run Configuration -> Logs -> Save console output to file

Stop command prompt from getting closed after executing a batch file

I used Shell command from Excel VBA to run a certain .bat file. The CMD appears but exits automatically after all lines were executed. I've added the PAUSE command a the end of the bat. file but it's not working. How to stop command prompt from getting automatically closed?
Try using the /K switch to prevent exiting after running the batch file like this:
cmd /K "path to batch file including file name and extension"
e.g.
cmd /K "C:\FOLDER\BATCH FILE.BAT"
or
cmd /K "C:\FOLDER\BATCH FILE.CMD"
Obviously that won't reveal any faults with your batch code, but it won't exit after running - much the same as running the batch file from the command line.
Definitely add some ECHO output lines to indicate progress as it runs and troubleshoot. Perhaps post the file here for more help.
Try opening the command prompt and running the batch file. It is possible that the the dos shell is encountering an error and closing. If the error comes before the execution reaches Pause command, it will not pause for you to read the error and it immediately closes off.
If that doesn't work out, check if you have any exit commands in any of the branches. Alternatively, place echo statements at different places and check if the execution control reaches these echos. This way you can find out if your script if ending at some other branch.
While perhaps not actually answering the posted question, I stumbled upon this question in a search to a very related-question. I was also trying to stop a command prompt from closing as it was erroring out and closing immediately. For me, it was sufficient for me to view the output as what I really wanted was to be able to see the error in order to debug it.
The solution I found was to pipe the output of the command prompt into a text file, like so:
MyScript.bat >> text.txt
This allowed me to see the error I was getting.

unable to set breakpoint in intellij

I am trying to set breakpoints, nothing happens for couple of classes that I compiled recently with "mvn install". I am able to set breakpoints to classes which were already built by someone else.
Please let me know if anyone knows how to solve it.
Had the same issue while using IDEA CE 15:
Removing the Python CE plugin 5.0.143.103 fixed the issue... but no Python parsing! :(
File -> Invalidate Caches and Restart helped solve the problem. Thanks Tomasz Nurkiewicz for the directions
In my case, the issue was caused by PHP Plugin (https://plugins.jetbrains.com/plugin/?id=6610). Even after "Invalidate Caches and Restart", the issue persisted.
Uninstalling that PHP plugin, solved my problem.
By nothing happens do you mean that breakpoint isn't hit? Take a closer look at breakpoint icon. Especially see the difference between
and
icons. The latter indicates the code you run while debugging doesn't have any meaningful instruction on that line.
One of the reasons for such behaviour is when code you run is not the code you see. It can happen when application server can is still running old JAR or something similar. This seems to be the case since you say that breakpoints work in older code.
The solution to fixing breakpoints was adding the wildcard file extension "*.py" to the Python File Types in Python (it must have the wildcard symbol prefix, not just ".py") through taking these steps:
Go to:
IntelliJ IDE > Preferences (CMD+,) > Editor > File Types > Recognized
File Types
Under "Recognized File Types" heading:
Scroll down; Select "Python"
(associated Registered Patterns will be shown below)
Under "Registered Patterns" heading:
Click "+" icon; Enter "*.py", Click OK
(do whatever is necessary to achieve this, including removing/renaming others without the wildcard if necessary)
Add breakpoints by:
Select line(s) of code (not an empty line or comment); Going to: Run >
Toggle Line Breakpoint (CMD+F8)
Configure debugging with breakpoints by going to:
Run > Edit Configurations...; Click "+"; Select "Python"; Add a value
for the "Name" property; Select location of the ".py" file to debug
(in the "Script" property); Click OK
Debug using the breakpoints by going to:
Run > Debug... (Fn+CMD+F9); Wait until it stops at a breakpoint;
Inspect variable values shown in the file itself by hovering over
variable; Click variables and view the Frame and Variable details in
the Debug window by going to: View > Tool Windows > Debug (CMD+5)
Important Note: Initially I tried doing the following but after each one I was still unable to use breakpoints afterward:
Removing and reinstalling the Python plugin:
Entering CMD+,; In the dialog window going to Plugins > Install
Jetbrains Plugin.. > "Python" > Install
Updating IntelliJ Ultimate edition to the latest version v2016.3.4
Going to:
File > Invalidate Caches and Restart
Right click on the gutter (where you normally click to set breakpoint)
select "Configure Gutter Icons..." then enable the checkbox at the top that says
"Show gutter icons"
That fixed it for me
Simply closing and reopening file worked in setting gutter breakpoints
This is embarrassing but posting here in case this solution will help somebody else: A breakpoint will not show up if you attempt to place it between executable lines of code. The breakpoint must be located on an executable line of code to work. Make sure you click on the gutter next to an executable line or place your cursor on an executable line when you use the shortcut. Once I did this, the breakpoints worked.
"Click the gutter at the executable line of code where you want to set the breakpoint." https://www.jetbrains.com/help/idea/using-breakpoints.html#set-breakpoints

Vim SQLComplete OMNI completion in Windows

I've recently started using VIM (7.2) in Windows and have been trying to use the OMNI completion feature when editing SQL.
When at the start of a new line it appears to work fine. For example, if I am in insert mode and type:
se <C-C>a
then the word 'select' appears. If I then try and use OMNI completion on any other word on the same line then I get the 'Pattern not found' error.
I get the same error if, when on a new line, I type a space before typing the ' se'.
Is this the intended behavior? Or is there something I need to configure to make this work?